static-cms/src/index.js

30 lines
770 B
JavaScript
Raw Normal View History

2016-02-25 00:45:56 -08:00
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
2016-07-15 15:05:04 -03:00
import { Router } from 'react-router';
2016-02-25 00:45:56 -08:00
import configureStore from './store/configureStore';
2016-07-15 15:05:04 -03:00
import routes from './routing/routes';
import history, { syncHistory } from './routing/history';
2016-08-17 09:52:17 -03:00
import { initPluginAPI } from './plugins';
2016-02-25 00:45:56 -08:00
import 'file?name=index.html!../example/index.html';
2016-07-08 07:12:52 -03:00
import './index.css';
2016-02-25 00:45:56 -08:00
const store = configureStore();
2016-07-18 15:07:59 -03:00
// Create an enhanced history that syncs navigation events with the store
syncHistory(store);
2016-08-17 09:52:17 -03:00
initPluginAPI(store);
2016-02-25 00:45:56 -08:00
const el = document.createElement('div');
2016-07-05 15:48:18 -03:00
el.id = 'root';
2016-02-25 00:45:56 -08:00
document.body.appendChild(el);
render((
<Provider store={store}>
2016-07-15 15:05:04 -03:00
<Router history={history}>
{routes}
</Router>
2016-02-25 00:45:56 -08:00
</Provider>
), el);