Skip to content

Commit cff44bd

Browse files
committed
Document that state is now frozen
1 parent 13acc21 commit cff44bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: versioned_docs/version-7.x/upgrading-from-6.x.md

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ const theme = {
151151
152152
If you want to customize the fonts, see [the themes guide](themes.md) for more details.
153153
154+
#### The navigation state is frozen in development mode
155+
156+
The navigation state is now frozen in development mode to prevent accidental mutations. This includes the state object and all the nested objects such as `route` object etc. If you're mutating the navigation state directly, you may get an error like `Cannot assign to read only property 'key' of object`.
157+
158+
Note that React Navigation relies on the immutability of the navigation state to detect changes and update the UI. Mutating the navigation state directly can cause issues and was never supported. So if you're mutating the navigation state directly, you'll need to use a different approach.
159+
154160
### Changes to linking
155161

156162
#### Encoding of params in path position is now more relaxed

0 commit comments

Comments
 (0)