react-navigation.github.io
react-navigation.github.io copied to clipboard
docs: Update 'Passing params to a previous screen'
I'm currently developing app that passes params from subsequent screens. One screen also has a screen that passes back additional route params.
I was not sure if I needed to pass all params to new screen or if the behaviour is the same as setParams.
It turns out that second behaviour is present.
I think it will be useful to mention it in the documentation.
Deploy preview for react-navigation-docs ready!
Built with commit 137f249fea992e4d7d69192cb95469e17ede21dc
https://deploy-preview-845--react-navigation-docs.netlify.app
Params are merged for every action, not just setParams or navigate. So I'm not sure mentioning it specifically in this example makes sense. If it wasn't obvious, maybe the better place to mention it is the getting started guides.
Sure. I couldn't find this information anywhere in documentation and had to test it in my app what is the actual behavior. I think it would be nice to mention it somewhere. Please, let me know where you think is the best place, so I can move it there.
Thanks, I think we can add a section in this page about what happens when passing params to an existing screen: https://reactnavigation.org/docs/params
Great! Thank you :D
I added new section. I don't like the title, so if you have any other ideas, let me know.
There have been a lot of changes regarding this in 6.x and 7.x, so for now, I'm closing this. We can revisit this later.