2016-11-08 23:54:54 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { render } from 'react-dom';
|
2019-08-28 20:08:40 +00:00
|
|
|
import { hot } from 'react-hot-loader/root';
|
2016-11-08 23:54:54 +00:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { Router, browserHistory } from 'react-router';
|
|
|
|
import configureStore from './store';
|
|
|
|
import routes from './routes';
|
|
|
|
|
|
|
|
require('./styles/main.scss');
|
|
|
|
|
2018-10-03 01:03:33 +00:00
|
|
|
// Load the p5 png logo, so that webpack will use it
|
|
|
|
require('./images/p5js-square-logo.png');
|
|
|
|
|
2016-11-08 23:54:54 +00:00
|
|
|
const history = browserHistory;
|
|
|
|
const initialState = window.__INITIAL_STATE__;
|
2019-06-06 21:17:33 +00:00
|
|
|
|
2016-11-08 23:54:54 +00:00
|
|
|
const store = configureStore(initialState);
|
|
|
|
|
2018-05-03 00:34:03 +00:00
|
|
|
const App = () => (
|
2016-11-08 23:54:54 +00:00
|
|
|
<Provider store={store}>
|
|
|
|
<Router history={history} routes={routes(store)} />
|
2018-05-03 00:34:03 +00:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
|
2019-08-28 20:08:40 +00:00
|
|
|
const HotApp = hot(App);
|
2018-05-03 00:34:03 +00:00
|
|
|
|
|
|
|
render(
|
|
|
|
<HotApp />,
|
2017-02-22 19:29:35 +00:00
|
|
|
document.getElementById('root')
|
2016-11-08 23:54:54 +00:00
|
|
|
);
|