Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active January 31, 2016 03:24
Show Gist options
  • Save StevenJL/ab99773e5b25a6dfcf37 to your computer and use it in GitHub Desktop.
Save StevenJL/ab99773e5b25a6dfcf37 to your computer and use it in GitHub Desktop.
import React from 'react'
import { createStore } from 'redux'
// import `Provider` from the react-redux
import { Provider } from 'react-redux'
// Assuming `App` is the root component
import App from './containers/App'
import todoApp from './reducers'
let store = createStore(todoApp)
let rootElement = document.getElementById('root')
ReactDOM.render(
// now `store` will be available to all the components below App
<Provider store={store}>
<App />
</Provider>,
rootElement
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment