Skip to content

Commit

Permalink
fix(expo-router): add gesture handler root view provider (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcalise authored May 17, 2024
1 parent 5f0e46b commit f41ed51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/recipes/ExpoRouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ We're now ready to start setting up navigation for the app! If you're familiar w
```tsx
// app/_layout.tsx
import React from "react";
import { ViewStyle } from "react-native"
import { Slot, SplashScreen } from "expo-router";
import { GestureHandlerRootView } from "react-native-gesture-handler"
import { useInitialRootStore } from "src/models";

SplashScreen.preventAutoHideAsync();
Expand All @@ -264,8 +266,14 @@ export default function Root() {
return null;
}

return <Slot />;
return (
<GestureHandlerRootView style={$root}>
<Slot />
</GestureHandlerRootView>
)
}

const $root: ViewStyle = { flex: 1 }
```

Move `ErrorBoundary` out of `screens/ErrorScreen` and into `src/components/ErrorBoundary`:
Expand Down

0 comments on commit f41ed51

Please sign in to comment.