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

View File

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