p5.js-web-editor/client/index.jsx

39 lines
992 B
React
Raw Permalink Normal View History

import React, { Suspense } from 'react';
import { render } from 'react-dom';
import { hot } from 'react-hot-loader/root';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
2020-01-19 21:05:16 +00:00
import configureStore from './store';
import routes from './routes';
import ThemeProvider from './modules/App/components/ThemeProvider';
import Loader from './modules/App/components/loader';
import i18n from './i18n';
require('./styles/main.scss');
// Load the p5 png logo, so that webpack will use it
require('./images/p5js-square-logo.png');
const history = browserHistory;
const initialState = window.__INITIAL_STATE__;
const store = configureStore(initialState);
2018-05-03 00:34:03 +00:00
const App = () => (
<Provider store={store}>
<ThemeProvider>
2020-01-19 21:05:16 +00:00
<Router history={history} routes={routes(store)} />
</ThemeProvider>
</Provider>
2018-05-03 00:34:03 +00:00
);
const HotApp = hot(App);
2018-05-03 00:34:03 +00:00
render(
<Suspense fallback={(<Loader />)}>
<HotApp />
</Suspense>,
document.getElementById('root')
);