Skip to content

Sharing context/state with multiple screens #7627

Answered by sssajjad007
AliAhmadi74 asked this question in Q&A
Discussion options

You must be logged in to vote

Re-renders aren’t triggered across screens when the context changes,
cuz contexts does not support proxy any more (hermes not supporting Proxy). i have same problem and i decided to use Redux instead.
like this

return Navigation.registerComponent(
  screenName,
  () => props =>
    (
      <ReduxProvider store={store}>
            <Component {...props} />
      </ReduxProvider>
    ),
  () => Component, // for navigation options
);

});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AliAhmadi74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants