react-navigation.github.io icon indicating copy to clipboard operation
react-navigation.github.io copied to clipboard

docs: Update 'Passing params to a previous screen'

Open jaworek opened this issue 5 years ago • 6 comments

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.

jaworek avatar Aug 10 '20 08:08 jaworek

Deploy preview for react-navigation-docs ready!

Built with commit 137f249fea992e4d7d69192cb95469e17ede21dc

https://deploy-preview-845--react-navigation-docs.netlify.app

netlify[bot] avatar Aug 10 '20 08:08 netlify[bot]

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.

satya164 avatar Nov 30 '20 17:11 satya164

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.

jaworek avatar Nov 30 '20 23:11 jaworek

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

satya164 avatar Dec 01 '20 13:12 satya164

Great! Thank you :D

jaworek avatar Dec 01 '20 18:12 jaworek

I added new section. I don't like the title, so if you have any other ideas, let me know.

jaworek avatar Dec 01 '20 19:12 jaworek

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.

satya164 avatar Oct 21 '22 08:10 satya164