Skip to content

Instantly share code, notes, and snippets.

@pavsidhu
Last active January 29, 2017 11:46
Show Gist options
  • Save pavsidhu/84ebb24520a128d1d7fdfc8947028d6f to your computer and use it in GitHub Desktop.
Save pavsidhu/84ebb24520a128d1d7fdfc8947028d6f to your computer and use it in GitHub Desktop.
Redux example
import React, {Component} from 'react'
import {AppRegistry} from 'react-native'
import {Provider} from 'react-redux'
import App from './app'
import configureStore from './store.js'
const store = configureStore()
class MyCounterApp extends Component {
render() {
return(
// <Provider> allows us to access the store for dispatching actions and receiving data from
// the state in it's children i.e. <App/>
<Provider store={store}>
<App/>
</Provider>
)
}
}
AppRegistry.registerComponent('MyCounterApp', () => MyCounterApp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment