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-18 09:09:54 -03:00
|
|
|
const Plugin = initPluginAPI();
|
2016-08-17 09:52:17 -03:00
|
|
|
|
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-08-18 09:09:54 -03:00
|
|
|
<Plugin>
|
|
|
|
<Router history={history}>
|
|
|
|
{routes}
|
|
|
|
</Router>
|
|
|
|
</Plugin>
|
2016-02-25 00:45:56 -08:00
|
|
|
</Provider>
|
|
|
|
), el);
|