Skip to content

Commit

Permalink
feat(native-stack): export NativeStackView to support custom routers …
Browse files Browse the repository at this point in the history
…on native-stack (#10260)

Currently, there is no way to create a custom navigator and router on top of **Native-Stack**

So by exporting **NativeStackView** along with its types from native-stack, we can use it along with **useNavigationBuilder** to create custom navigators​ with some additional functionality built on top of it.

We can also use **StackRouter** from **@react-navigation/native** to create customised routers and use it with the navigator we created on top of **NativeStackView**.

We can follow the same doc to extend NativeStackView with our own router or build additional functionality on top of it.
https://reactnavigation.org/docs/custom-navigators#extending-navigators.

Co-authored-by: Aditya Pahilwani <aditya.pahilwani@groww.in>
  • Loading branch information
AdityaPahilwani and AdityaPahilwaniGroww committed Jan 27, 2022
1 parent 393773b commit 7b761f1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/bottom-tabs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type {
BottomTabBarButtonProps,
BottomTabBarProps,
BottomTabHeaderProps,
BottomTabNavigationEventMap,
BottomTabNavigationOptions,
BottomTabNavigationProp,
BottomTabScreenProps,
Expand Down
1 change: 1 addition & 0 deletions packages/drawer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export { default as useDrawerStatus } from './utils/useDrawerStatus';
export type {
DrawerContentComponentProps,
DrawerHeaderProps,
DrawerNavigationEventMap,
DrawerNavigationOptions,
DrawerNavigationProp,
DrawerScreenProps,
Expand Down
1 change: 1 addition & 0 deletions packages/material-bottom-tabs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { default as MaterialBottomTabView } from './views/MaterialBottomTabView'
* Types
*/
export type {
MaterialBottomTabNavigationEventMap,
MaterialBottomTabNavigationOptions,
MaterialBottomTabNavigationProp,
MaterialBottomTabScreenProps,
Expand Down
1 change: 1 addition & 0 deletions packages/material-top-tabs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export { default as MaterialTopTabView } from './views/MaterialTopTabView';
*/
export type {
MaterialTopTabBarProps,
MaterialTopTabNavigationEventMap,
MaterialTopTabNavigationOptions,
MaterialTopTabNavigationProp,
MaterialTopTabScreenProps,
Expand Down
6 changes: 6 additions & 0 deletions packages/native-stack/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
*/
export { default as createNativeStackNavigator } from './navigators/createNativeStackNavigator';

/**
* Views
*/
export { default as NativeStackView } from './views/NativeStackView';

/**
* Types
*/
export type {
NativeStackHeaderProps,
NativeStackNavigationEventMap,
NativeStackNavigationOptions,
NativeStackNavigationProp,
NativeStackScreenProps,
Expand Down
1 change: 1 addition & 0 deletions packages/stack/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type {
StackHeaderInterpolationProps,
StackHeaderProps,
StackHeaderStyleInterpolator,
StackNavigationEventMap,
StackNavigationOptions,
StackNavigationProp,
StackScreenProps,
Expand Down

0 comments on commit 7b761f1

Please sign in to comment.