Created
April 1, 2017 01:26
-
-
Save gHashTag/2b558a9d2ba4f436e6793d0744685b85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 React, { Component } from 'react' | |
import { Provider } from 'react-redux' | |
import { createStore, applyMiddleware, combineReduxers, compose } from 'redux' | |
import thunkMiddleware from 'redux-thunk' | |
import createLogger from 'redux-logger' | |
import reducer from './app/reducers' | |
// middleware that logs actions | |
const loggerMiddleware = createLogger({ predicate: (getState, action) => __DEV__ }) | |
function configureStore(initialState) { | |
const enhancer = compose( | |
applyMiddleware( | |
thunkMiddleware, // lets us dispatch() functions | |
loggerMiddleware, | |
), | |
); | |
return createStore(reducer, initialState, enhancer) | |
} | |
const store = configureStore({}) | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native' | |
export default class Peckish extends Component { | |
render() { | |
return ( | |
<View> | |
<Text> | |
Welcome to React Native! | |
</Text> | |
</View> | |
) | |
} | |
} | |
const App = () => ( | |
<Provider store={store}> | |
<Peckish /> | |
</Provider> | |
) | |
AppRegistry.registerComponent('Peckish', () => App) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment