Search code examples
react-nativereact-navigationreact-native-state

Is it possible a state that among two screen and able to setState from the two screens?


I have occured this problem on my project.I really confused what I'm gonna do.


Solution

  • A state can be passed to another screen with a parameter. See docs for further information.

    Please beware that passing params isn't meant to pass whole objects but ids or queries of some kind. In some cases you might want to think about state management with redux, mobx or zustand. However, this highly depends on the your problem.

    Would be great to get some more details on your actual problem to be more helpful :-)

    https://reactnavigation.org/docs/params