// tslint:disable-next-line no-unused-variable
import * as React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { createStore, Store } from 'redux'
import { hashHistory, Route, Router } from 'react-router'

import { App } from './components/App'
import { rootReducer } from './reducers/rootReducer'
import { RootStore } from './model/RootStore'

const store: Store<RootStore> = createStore<RootStore>(rootReducer)

render(
  <Provider store={store}>
    <Router history={hashHistory}>
      <Route component={App}>
        <Route path="/"/>
        <Route path="/active"/>
        <Route path="/completed"/>
      </Route>
    </Router>
  </Provider>,
  document.getElementById('root')
)
// tslint:disable-next-line no-unused-variable
import * as React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { createStore, Store } from 'redux'

import { App } from './components/App'
import { rootReducer } from './reducers/rootReducer'
import { RootStore } from './model/RootStore'

const initialState = new RootStore({
  todos: [],
  visibilityFilter: 'SHOW_ALL'
})

const store: Store<RootStore> = createStore<RootStore>(rootReducer, initialState)

render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
)
--- 
+++ 
@@ -3,21 +3,23 @@
 import { render } from 'react-dom'
 import { Provider } from 'react-redux'
 import { createStore, Store } from 'redux'
+import { hashHistory, Route, Router } from 'react-router'
 
 import { App } from './components/App'
 import { rootReducer } from './reducers/rootReducer'
 import { RootStore } from './model/RootStore'
 
-const initialState = new RootStore({
-  todos: [],
-  visibilityFilter: 'SHOW_ALL'
-})
-
-const store: Store<RootStore> = createStore<RootStore>(rootReducer, initialState)
+const store: Store<RootStore> = createStore<RootStore>(rootReducer)
 
 render(
   <Provider store={store}>
-    <App />
+    <Router history={hashHistory}>
+      <Route component={App}>
+        <Route path="/"/>
+        <Route path="/active"/>
+        <Route path="/completed"/>
+      </Route>
+    </Router>
   </Provider>,
   document.getElementById('root')
 )
Remove initial state and add router
