fix: add GestureHandlerRootView to root layout; install react-native-gesture-handler

This commit is contained in:
Nemo
2026-03-24 14:01:20 +08:00
parent dcff516375
commit e9a76baf90
2 changed files with 7 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import '../global.css';
import { useEffect } from 'react';
import { Stack, router } from 'expo-router';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { useAuthStore } from '../stores/authStore';
const queryClient = new QueryClient();
@@ -24,8 +25,10 @@ export default function RootLayout() {
}, [isLoading, token]);
return (
<QueryClientProvider client={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</QueryClientProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<QueryClientProvider client={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</QueryClientProvider>
</GestureHandlerRootView>
);
}

View File

@@ -27,6 +27,7 @@
"nativewind": "^4.1.23",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-gesture-handler": "~2.28.0",
"react-native-maps": "1.20.1",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",