React-redux Records

Source: Internet
Author: User

React-redux provides two key modules: provider and connect.

Provider

Provider This module as the entire app container, in your original app container on the basis of a layer, it is very simple to accept the Redux store as props, and declare it as one of the properties of the context, which can be conveniently accessed to the store viaThis.context.storeaftercontexttypeshas been declared. However, our components do not usually need to do this, put the store in the context for the following connect to use.

This is an example of the use of provider:

 

// config app root const history = createHistory()
const root = ( <Provider store={store} key="provider">
    <Router history={history} routes={routes} />
  </Provider> ) // render ReactDOM.render(
  root,
  document.getElementById(‘root‘)
)

 

 

React-redux record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.