Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 770 Bytes

08-connecting-to-react.md

File metadata and controls

27 lines (16 loc) · 770 Bytes

Connecting to React

The next step is to connect to React using react-redux. Use the document here to help you.

  1. Install react-redux:

     npm install --save react-redux
    
  2. Create container components using connect() together with mapStateToProps() and mapDispatchToProps().

  3. Pass the store down by wrapping the top-level App component in a Provider.

Oh! I forgot to say: for point (3) you'll need to wrap your App component in a Provider, passing in the store, like this:

render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
)

See here for details.