@@ -6,17 +6,29 @@ First install `@bottom-tabs/react-navigation` which provides a native bottom tab
66
77<PackageManagerTabs command = " install @bottom-tabs/react-navigation" />
88
9- First , create a custom layout adapter for the native bottom tabs:
9+ Next , create a custom layout adapter for the native bottom tabs using ` withLayoutContext ` from Expo Router :
1010
1111``` tsx
12- import { withLayoutContext } from " expo-router" ;
13- import { createNativeBottomTabNavigator } from ' @bottom-tabs/react-navigation' ;
14-
15- export const Tabs = withLayoutContext (
16- createNativeBottomTabNavigator ().Navigator
17- );
12+ import { withLayoutContext } from ' expo-router' ;
13+ import {
14+ createNativeBottomTabNavigator ,
15+ NativeBottomTabNavigationOptions ,
16+ NativeBottomTabNavigationEventMap ,
17+ } from ' @bottom-tabs/react-navigation' ;
18+ import { ParamListBase , TabNavigationState } from ' @react-navigation/native' ;
19+
20+ const BottomTabNavigator = createNativeBottomTabNavigator ().Navigator ;
21+
22+ const Tabs = withLayoutContext <
23+ NativeBottomTabNavigationOptions ,
24+ typeof BottomTabNavigator ,
25+ TabNavigationState < ParamListBase > ,
26+ NativeBottomTabNavigationEventMap
27+ > (BottomTabNavigator );
1828```
1929
30+ > [ !NOTE] Make sure to provide the correct types for the ` withLayoutContext ` function. Without it screen options won't have proper types.
31+
2032Then, use the ` Tabs ` navigator in your app:
2133
2234``` tsx
0 commit comments