Reputation: 29
I have a problem to pass params to main screen from multiple other screens. When I'm getting params from second screen params from first screen are removed.
I'm using workaround with useEffect and useState to keep those data from params but maybe there is simpler solution to this problem?
Upvotes: 0
Views: 343
Reputation: 528
If you are passing params from first screen to main screen, then send only first screen params. If you are passing params from second screen to main screen, then first pass first screen params to second screen and then pass both first and second screen params to main screen.
Alternatively you can set your params in Context API to keep your params saved throughout the app. Please read https://reactjs.org/docs/context.html and this
Upvotes: 1