<Provider> component makes the Redux
store available to any nested components that need to access the Redux store.
Since any React component in a React Redux app can be connected to the store, most applications will render a
<Provider> at the top level, with the entire app’s component tree inside of it.
store (Redux Store)
The single Redux
store in your application.
The root of your component hierarchy.
You may provide a context instance. If you do so, you will need to provide the same context instance to all of your connected components as well. Failure to provide the correct context results in runtime error:
Could not find "store" in the context of "Connect(MyComponent)". Either wrap the root component in a
<Provider>, or pass a custom React context provider to
<Provider>and the corresponding React context consumer to Connect(Todo) in connect options.
In the example below, the
<App /> component is our root-level component. This means it’s at the very top of our component hierarchy.