Skip to content

Commit 3c26ca7

Browse files
authored
Update code samples in Stack Navigator docs to correctly use defaultNavigationOptions in navigator config
1 parent 6d5b6ff commit 3c26ca7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/stack-navigator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ createStackNavigator({
3131
// The action and route params are extracted from the path.
3232

3333
// Optional: Override the `navigationOptions` for the screen
34-
navigationOptions: ({ navigation }) => ({
34+
defaultNavigationOptions: ({ navigation }) => ({
3535
title: `${navigation.state.params.name}'s Profile'`,
3636
}),
3737
},
@@ -261,7 +261,7 @@ const ModalNavigator = createStackNavigator(
261261
{
262262
headerMode: 'none',
263263
mode: 'modal',
264-
navigationOptions: {
264+
defaultNavigationOptions: {
265265
gesturesEnabled: false,
266266
},
267267
transitionConfig: () => ({
@@ -321,4 +321,4 @@ const HomeStack = createStackNavigator(
321321
{ DetailScreen, HomeScreen, OptionsScreen },
322322
{ initialRouteName: 'HomeScreen', transitionConfig: dynamicModalTransition }
323323
);
324-
```
324+
```

0 commit comments

Comments
 (0)