You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/handling-safe-area.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -473,6 +473,6 @@ Similarly, you could apply these paddings in `contentContainerStyle` of `FlatLis
473
473
474
474
## Summary
475
475
476
-
- Use `useSafeAreaInsets` hook from `react-native-safe-area-context` instead of `SafeAreaView` component
476
+
- Use [`useSafeAreaInsets`](https://appandflow.github.io/react-native-safe-area-context/api/use-safe-area-insets) hook from `react-native-safe-area-context` instead of [`SafeAreaView`](https://reactnative.dev/docs/safeareaview) component
477
477
- Don't wrap your whole app in `SafeAreaView`, instead apply the styles to content inside your screens
478
478
- Apply only specific insets using the `useSafeAreaInsets` hook for more control
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/header-buttons.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,6 +297,6 @@ Generally, this is what you want. But it's possible that in some circumstances t
297
297
298
298
## Summary
299
299
300
-
- You can set buttons in the header through the `headerLeft` and `headerRight` properties in `options`.
301
-
- The back button is fully customizable with `headerLeft`, but if you just want to change the title or image, there are other `options` for that —`headerBackTitle`, `headerBackTitleStyle`, and `headerBackImageSource`.
302
-
- You can use a callback for the options prop to access `navigation` and `route` objects.
300
+
- You can set buttons in the header through the [`headerLeft`](elements.md#headerleft) and [`headerRight`](elements.md#headerright) properties in [`options`](screen-options.md).
301
+
- The back button is fully customizable with `headerLeft`, but if you only want to change the title or image, there are other `options` for that —[`headerBackTitle`](native-stack-navigator.md#headerbacktitle), [`headerBackTitleStyle`](native-stack-navigator.md#headerbacktitlestyle), and [`headerBackImageSource`](native-stack-navigator.md#headerbackimagesource).
302
+
- You can use a callback for the options prop to access [`navigation`](navigation-object.md) and [`route`](route-object.md) objects.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/headers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -689,6 +689,6 @@ You can read the full list of available `options` for screens inside of a native
689
689
690
690
## Summary
691
691
692
-
- You can customize the header inside of the `options` property of your screens. Read the full list of options [in the API reference](native-stack-navigator.md#options).
693
-
- The `options` property can be an object or a function. When it is a function, it is provided with an object with the `navigation` and `route` objects.
694
-
- You can also specify shared `screenOptions` in the stack navigator configuration when you initialize it. This will apply to all screens in the navigator.
692
+
- You can customize the header inside of the [`options`](screen-options.md) property of your screens. Read the full list of options [in the API reference](native-stack-navigator.md#options).
693
+
- The `options` property can be an object or a function. When it is a function, it is provided with an object with the [`navigation`](navigation-object.md) and [`route`](route-object.md) objects.
694
+
- You can also specify shared [`screenOptions`](screen-options.md#screenoptions-prop-on-the-navigator) in the stack navigator configuration when you initialize it. This will apply to all screens in the navigator.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/hello-react-navigation.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -525,19 +525,19 @@ If you are using TypeScript, you will need to specify the types accordingly. You
525
525
<TabItemvalue="static"label="Static"default>
526
526
527
527
- React Native doesn't have a built-in API for navigation like a web browser does. React Navigation provides this for you, along with the iOS and Android gestures and animations to transition between screens.
528
-
-`createNativeStackNavigator` is a function that takes the screens configuration and renders our content.
528
+
-[`createNativeStackNavigator`](native-stack-navigator.md) is a function that takes the screens configuration and renders our content.
529
529
- Each property under screens refers to the name of the route, and the value is the component to render for the route.
530
-
- To specify what the initial route in a stack is, provide an `initialRouteName` option for the navigator.
531
-
- To specify screen-specific options, we can specify an `options` property, and for common options, we can specify `screenOptions`.
530
+
- To specify what the initial route in a stack is, provide an [`initialRouteName`](navigator.md#initial-route-name) option for the navigator.
531
+
- To specify screen-specific options, we can specify an [`options`](screen-options.md#options-prop-on-screen) property, and for common options, we can specify [`screenOptions`](screen-options.md#screenoptions-prop-on-the-navigator).
532
532
533
533
</TabItem>
534
534
<TabItemvalue="dynamic"label="Dynamic">
535
535
536
536
- React Native doesn't have a built-in API for navigation like a web browser does. React Navigation provides this for you, along with the iOS and Android gestures and animations to transition between screens.
537
-
-`Stack.Navigator` is a component that takes route configuration as its children with additional props for configuration and renders our content.
538
-
- Each `Stack.Screen` component takes a `name` prop which refers to the name of the route and `component` prop which specifies the component to render for the route. These are the 2 required props.
539
-
- To specify what the initial route in a stack is, provide an `initialRouteName` as the prop for the navigator.
540
-
- To specify screen-specific options, we can pass an `options` prop to `Stack.Screen`, and for common options, we can pass `screenOptions` to `Stack.Navigator`.
537
+
-[`Stack.Navigator`](native-stack-navigator.md) is a component that takes route configuration as its children with additional props for configuration and renders our content.
538
+
- Each [`Stack.Screen`](screen.md) component takes a [`name`](screen.md#name) prop which refers to the name of the route and [`component`](screen.md#component) prop which specifies the component to render for the route. These are the 2 required props.
539
+
- To specify what the initial route in a stack is, provide an [`initialRouteName`](navigator.md#initial-route-name) as the prop for the navigator.
540
+
- To specify screen-specific options, we can pass an [`options`](screen-options.md#options-prop-on-screen) prop to `Stack.Screen`, and for common options, we can pass [`screenOptions`](screen-options.md#screenoptions-prop-on-the-navigator) to `Stack.Navigator`.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/modal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,7 +185,7 @@ Instead of specifying this option for a group, it's also possible to specify it
185
185
186
186
## Summary
187
187
188
-
- To change the type of transition on a stack navigator you can use the `presentation` option.
188
+
- To change the type of transition on a stack navigator you can use the [`presentation`](native-stack-navigator.md#presentation) option.
189
189
- When `presentation` is set to `modal`, the screens behave like a modal, i.e. they have a bottom to top transition and may show part of the previous screen in the background.
190
190
- Setting `presentation: 'modal'` on a group makes all the screens in the group modals, so to use non-modal transitions on other screens, we add another group with the default configuration.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/navigating.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,8 +358,8 @@ export default function App() {
358
358
359
359
## Summary
360
360
361
-
-`navigation.navigate('RouteName')` pushes a new route to the native stack navigator if you're not already on that route.
362
-
- We can call `navigation.push('RouteName')` as many times as we like and it will continue pushing routes.
363
-
- The header bar will automatically show a back button, but you can programmatically go back by calling `navigation.goBack()`. On Android, the hardware back button just works as expected.
364
-
- You can go back to an existing screen in the stack with `navigation.popTo('RouteName')`, and you can go back to the first screen in the stack with `navigation.popToTop()`.
365
-
- The `navigation` object is available to all screen components with the [`useNavigation`](use-navigation.md) hook.
361
+
-[`navigation.navigate('RouteName')`](navigation-object.md#navigate) pushes a new route to the native stack navigator if you're not already on that route.
362
+
- We can call [`navigation.push('RouteName')`](stack-actions.md#push) as many times as we like and it will continue pushing routes.
363
+
- The header bar will automatically show a back button, but you can programmatically go back by calling [`navigation.goBack()`](navigation-object.md#goback). On Android, the hardware back button just works as expected.
364
+
- You can go back to an existing screen in the stack with [`navigation.popTo('RouteName')`](stack-actions.md#popto), and you can go back to the first screen in the stack with [`navigation.popToTop()`](stack-actions.md#poptotop).
365
+
- The [`navigation`](navigation-object.md) object is available to all screen components with the [`useNavigation`](use-navigation.md) hook.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/navigation-lifecycle.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -627,6 +627,6 @@ If you want to know if the screen is focused or not inside of an event listener,
627
627
## Summary
628
628
629
629
- React Navigation does not unmount screens when navigating away from them
630
-
- The `useFocusEffect` hook is analogous to React's `useEffect` but is tied to the navigation lifecycle instead of the component lifecycle.
631
-
- The `useIsFocused` hook and `navigation.isFocused` method can be used to determine if a screen is currently focused.
632
-
- React Navigation emits `focus` and `blur` events that can be listened to when a screen comes into focus or goes out of focus.
630
+
- The [`useFocusEffect`](use-focus-effect.md) hook is analogous to React's [`useEffect`](https://react.dev/reference/react/useEffect) but is tied to the navigation lifecycle instead of the component lifecycle.
631
+
- The [`useIsFocused`](use-is-focused.md) hook and [`navigation.isFocused()`](navigation-object.md#isfocused) method can be used to determine if a screen is currently focused.
632
+
- React Navigation emits [`focus`](navigation-events.md#focus) and [`blur`](navigation-events.md#blur) events that can be listened to when a screen comes into focus or goes out of focus.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/params.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -373,7 +373,7 @@ export default function App() {
373
373
374
374
See [Nesting navigators](nesting-navigators.md) for more details on nesting.
375
375
376
-
:::warning
376
+
## Reserved param names
377
377
378
378
Some param names are reserved by React Navigation as part of the API for nested navigators. The list of the reserved param names are as follows:
379
379
@@ -384,8 +384,6 @@ Some param names are reserved by React Navigation as part of the API for nested
384
384
385
385
You should avoid using these param names in your code unless navigating to a screen containing a nested navigator. Otherwise it will result in unexpected behavior, such as the screen not being able to access the params you passed. If you need to pass data to a nested screen, use a different names for the param.
386
386
387
-
:::
388
-
389
387
## What should be in params
390
388
391
389
Params are essentially options for a screen. They should contain the minimal data required to show a screen, nothing more. If the data is used by multiple screens, it should be in a global store or global cache. Params is not designed for state management.
@@ -436,8 +434,9 @@ In essence, pass the least amount of data required to identify a screen in param
436
434
437
435
## Summary
438
436
439
-
- `navigate` and `push` accept an optional second argument to let you pass parameters to the route you are navigating to. For example: `navigation.navigate('RouteName', { paramName:'value' })`.
440
-
- You can read the params through `route.params` inside a screen
441
-
- You can update the screen's params with `navigation.setParams`
442
-
- Initial params can be passed via the `initialParams` prop on `Screen`
437
+
- [`navigate`](navigation-actions.md#navigate) and [`push`](stack-actions.md#push) accept an optional second argument to let you pass parameters to the route you are navigating to. For example: `navigation.navigate('RouteName', { paramName:'value' })`.
438
+
- You can read the params through [`route.params`](route-object.md) inside a screen
439
+
- You can update the screen's params with [`navigation.setParams`](navigation-object.md#setparams) or [`navigation.replaceParams`](navigation-object.md#replaceparams)
440
+
- Initial params can be passed via the [`initialParams`](screen.md#initialparams) prop on `Screen` or in the navigator config
443
441
- Params should contain the minimal data required to show a screen, nothing more
442
+
- Some [param names are reserved](#reserved-param-names) by React Navigation and should be avoided
0 commit comments