[SDK 39] React Navigation navigation.setOptions in function component shows warning
See original GitHub issue🐛 Bug Report
If I use, for example,navigation.setOptions({ title: 'Title' })
to set a dynamic title in a React Navigation screen, in SDK 39 it now shows me the warning Cannot update a component from inside the function body of a different component
. This did not show in SDK 38.
Is this a bug or is there some new recommended way of doing things?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Troubleshooting | React Navigation
I get the warning "Non-serializable values were found in the navigation state". This can happen if you are passing non-serializable values such as...
Read more >React Native Cannot update a component from inside the ...
Finally I found solution :) it is simple :) I wrapped navigation.setOption({ ... }) by componentDidUpdate(){}. DefaultLogin.js
Read more >react cannot update component while rendering a different ...
I'm trying to create a toggle input that has controlled state and will make a call to my apps backend. Functionally it works,...
Read more >React Native Navigation: Tutorial with examples
In this React Native Navigation tutorial, we'll show you some examples of navigation patterns you can implement with React Navigation.
Read more >Building a chat app with Socket.io and React Native - Novu
Install Socket.io Client API to the React Native app. ... 1npm install @react-navigation/native 2npx expo install react-native-screens ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Put navigation.setOptions inside a useEffect
https://github.com/react-navigation/react-navigation/issues/8796
this issue belongs on the react-navigation repo 😃 we work on that library too but we don’t track issues here