Thanks @corsal8
, not quite what I meant: if you look on the same react-native doc it's the setParam function I'm trying to use. Not sure of the syntax when using it in a functional component compared to the class component that the docs exemplify :)
Harshil is a JavaScript dev, community builder and open source enthusiast. He is a Major League Hacking Coach, Mozilla Representative, and GitHub Campus Expert. He builds apps for both mobile and web.
Hey kiwipedro I am glad that the article could help. To use the setParams() method the structure is similar to navigate() method as shown in the article above, navigation.setParams({...})
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Harshil, that's really helpful. How would you handled setParams to make the header dynamic?
Hi! I'm not the OP, but I've made the header dynamic by passing to the Home.navigationOptions function the navigation parameter like so:
This should work based on the React Navigation doc (reactnavigation.org/docs/en/header...).
Last but not least, I'm completely new to React Native, so take my answer with a grain of salt :)
Thanks @corsal8 , not quite what I meant: if you look on the same react-native doc it's the setParam function I'm trying to use. Not sure of the syntax when using it in a functional component compared to the class component that the docs exemplify :)
Hey kiwipedro I am glad that the article could help. To use the setParams() method the structure is similar to navigate() method as shown in the article above,
navigation.setParams({...})