You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We still need to provide specific actions and dispatchers
Provider is a way to create the equivalent of a global variable
Adds named data to the props of all of the elements within its scope
We won't actually refer to store ourselves
It will be connected when we wire everything together
Connecting the Pieces
Modify App.js (our container)
connect takes two functions
Wraps the App class with something that knows how to talk to a default store
This code relies on the store variable created by the Provider
// ...as before...import{connect}from"react-redux";import{setSearchTerm}from"../actions";// ...map state to properties...// ...map dispatch function to properties...classAppextendsComponent{// ...constructor...// ...initial data fetch...// ...render...}exportdefaultconnect(mapStateToProps,mapDispatchToProps)(App)
Mapping State to Properties
Given a state, generate the change to the properties