-
-
Save Arrow7000/0ec7de769b58a44be99129f638995bab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore } from 'redux'; | |
import { Provider } from 'react-redux'; | |
const store = createStore(reducer); | |
// dispatch action directly | |
store.dispatch(makeIncrementByAction(5)); | |
// make store available to all descendants of Provider | |
function App() { | |
return ( | |
<Provider store={store}> | |
{/* SmartCounter and all its descendants | |
are now connected to the store */} | |
<SmartCounter /> | |
</Provider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment