setting base href support for router

This commit is contained in:
Cássio Zen
2016-07-15 15:05:04 -03:00
parent 5d6eec28bb
commit e3643217de
8 changed files with 53 additions and 35 deletions

View File

@ -1,8 +1,10 @@
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Router } from 'react-router';
import configureStore from './store/configureStore';
import Routes from './routes/routes';
import routes from './routing/routes';
import history, { syncHistory } from './routing/history';
import 'file?name=index.html!../example/index.html';
import './index.css';
@ -12,8 +14,13 @@ const el = document.createElement('div');
el.id = 'root';
document.body.appendChild(el);
// Create an enhanced history that syncs navigation events with the store
syncHistory(store);
render((
<Provider store={store}>
<Routes/>
<Router history={history}>
{routes}
</Router>
</Provider>
), el);