Skip to content

Commit cfb683e

Browse files
committed
Document reserved param names
1 parent d80708a commit cfb683e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

versioned_docs/version-7.x/params.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,19 @@ export default function App() {
373373
374374
See [Nesting navigators](nesting-navigators.md) for more details on nesting.
375375
376+
:::warning
377+
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+
380+
- `screen`
381+
- `params`
382+
- `initial`
383+
- `state`
384+
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+
387+
:::
388+
376389
## What should be in params
377390
378391
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.

0 commit comments

Comments
 (0)