0

How to write the redux data-flow using react-native-navigation? this is my codes:

- Navigation.registerComponent('Scan', () => props => (   <Provider
  store={store}>
      <ScanScreen {...props} />   </Provider> ))
1
  • 1
    Please be a bit more specific when asking a question: What have you tried so far with a code example? (I downvoted because there is no code) / What do you expect? / What error do you get? For Help take a look at "How to ask" Commented May 18, 2020 at 6:24

1 Answer 1

2

You need to use registerComponentWithRedux from react-native-navigation instead of registerComponent

And you do not need to manually wrap your component in Provider.

Please refer below snippet for integration:

Navigation.registerComponentWithRedux(
    "your_route_name",
    () => YourScreenComponent,
    Provider,
    store
);

In above code snippet:

  1. You will get Provider from : import { Provider } from 'react-redux';
  2. store which you with configure using redux configureStore method
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.