Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheeBryanWhite/0750b838a8b0e020178d23e719829d61 to your computer and use it in GitHub Desktop.
Save TheeBryanWhite/0750b838a8b0e020178d23e719829d61 to your computer and use it in GitHub Desktop.
// Store.js
import { createStore, compose, applyMiddleware } from 'redux';
import rootReducer from '../reducers/index';
import thunk from 'redux-thunk';
// const store = createStore(rootReducer);
const store = createStore(
rootReducer,
compose(
applyMiddleware(thunk)
)
);
export default store;
// App.js
import React, { Component } from 'react';
import { Provider } from "react-redux";
import store from "./redux/store/index";
import AppRegistry from 'react-native'
import { StyleSheet, View } from 'react-native';
import Main from './src/components/Main';
export default function App() {
return (
<Provider store={store}>
<View style={styles.container}>
<Main />
</View>
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
width: '100%'
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment