Created
November 24, 2017 19:52
-
-
Save nomanHasan/4a4a88813b4026ca6c0d3b06683ae153 to your computer and use it in GitHub Desktop.
App.js
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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
//Import the modified App.css | |
import './App.css'; | |
// Import the Routes component, which contains our Route setup | |
import { Routes } from './Routes' | |
// Provider component is a react-redux component for setting up the Redux Store | |
import { Provider } from 'react-redux' | |
// Import the ConfigureStore that holds the initial Configuration | |
import { configureStore } from './store/configureStore' | |
import * as TodoActions from './todos/actions/todoActions' | |
import AppBar from 'material-ui/AppBar'; | |
// Create a Store from the Configuration, we can pass a Initial State here | |
const store = configureStore() | |
// At first dispatch a Get Todos Actions, So we'll recieve the Todos | |
// fetched from the server at the start of the app | |
store.dispatch(TodoActions.GetTodos()) | |
const App = (props) => { | |
return ( | |
//Provider needs to contain all the Containers/Components it will give access to the Store | |
<Provider store={store} > | |
<Routes /> | |
</Provider> | |
) | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment