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
{{ message }}
This repository was archived by the owner on Dec 3, 2022. It is now read-only.
I've noticed that for some reason navigationOptions aren't set correctly when using useEffect to initialize them when component mounts.
Here's a basic test scenario to reproduce this:
functionTestScreen(){constnavigation=useNavigation();useEffect(()=>{console.log('component did mount');navigation.setParams({test: true,});},[]);returnnull;}TestScreen.navigationOptions=(screenProps)=>{console.log('navigationOptions',screenProps.navigation.state.params);};
When this screen gets navigated to, here's what I see in logs:
navigationOptions undefined
component did mount
navigationOptions {test: true}
navigationOptions undefined
Shouldn't it be:
navigationOptions undefined
component did mount
navigationOptions {test: true}
I've also noticed that output is correct when I wrap navigation.setParams in setTimeout: