From 8995438b9a8649d30d870826d0f8fbf283d68933 Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Sun, 12 May 2024 17:51:35 +0530
Subject: Fix problem with autofocus in textinput

---
 App.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'App.tsx')

diff --git a/App.tsx b/App.tsx
index a0eda25..1b42456 100644
--- a/App.tsx
+++ b/App.tsx
@@ -5,7 +5,9 @@ import Swiper from 'react-native-swiper';
 import {AppList} from './src/screens/AppList';
 
 function App(): React.JSX.Element {
-  const [apps, _setApps] = useState(() => InstalledApps.getSortedApps());
+  const [apps, setApps] = useState(() => InstalledApps.getSortedApps());
+  const refreshApps = () => setApps(InstalledApps.getSortedApps());
+  const [screenIndex, setScreenIndex] = useState(0);
 
   return (
     <SafeAreaView className="flex flex-1 bg-slate-100 dark:bg-black">
@@ -15,12 +17,14 @@ function App(): React.JSX.Element {
         loop={false}
         loadMinimal
         dot={<></>}
-        activeDot={<></>}>
+        activeDot={<></>}
+        index={screenIndex}
+        onIndexChanged={setScreenIndex}>
         <View>
           <Text>Wow</Text>
         </View>
 
-        <AppList apps={apps} />
+        <AppList apps={apps} screenIndex={screenIndex} />
       </Swiper>
     </SafeAreaView>
   );
-- 
cgit v1.3.1

