import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter } from 'react-router-dom'
import { Provider } from 'react-redux'
import App from './app'
import { initializeServiceWorkers } from './workbox'
import store from './store'


const render = (AppComponent) => {
  ReactDOM.render(
    (
      <Provider store={store}>
        <BrowserRouter>
          <AppComponent />
        </BrowserRouter>
      </Provider>
    ),
    // eslint-disable-next-line
    document.getElementById('root'),
  )
}

render(App)
initializeServiceWorkers()

if (module.hot) {
  module.hot.accept('./app', () => {
    // eslint-disable-next-line
    const UpdatedApp = require('./app').default
    render(UpdatedApp)
  })
}

import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter } from 'react-router-dom'
import { renderRoutes } from 'react-router-config'
import { Provider } from 'react-redux'
import { initializeServiceWorkers } from './workbox'
import store from './store'
import routes from './routes'


const render = () => {
  ReactDOM.render(
    (
      <Provider store={store}>
        <BrowserRouter>
          {renderRoutes(routes)}
        </BrowserRouter>
      </Provider>
    ),
    // eslint-disable-next-line
    document.getElementById('root'),
  )
}

render()
initializeServiceWorkers()

if (module.hot) {
  module.hot.accept()
}

Replace jsx routes with json routes
Replace jsx routes with json routes

- add react-router-config dependency
- replace jsx routes in src/index src/app src/routes

I did this because SSR should be easier to make then.
