This commit is contained in:
crusader 2017-07-21 16:08:04 +09:00
parent 4a50fe2cd6
commit a563cbb9fa
2 changed files with 14 additions and 22 deletions

View File

@ -1,19 +1,16 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { fork } from 'redux-saga/effects';
import { Provider } from 'react-redux';
import { Provider, Store } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import * as injectTapEventPlugin from 'react-tap-event-plugin';
import { Store } from 'redux';
import createSagaMiddleware, { SagaMiddleware } from 'redux-saga';
import { History } from 'history';
import * as injectTapEventPlugin from 'react-tap-event-plugin';
import Platform from '@overflow/commons/platform';
import AppContext from '@overflow/commons/context';
import * as AppContextLifecycleActions from '@overflow/commons/context/redux/action/lifecycle';
import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC';
import { History } from 'history';
import { store, sagaMiddleware, history } from './redux/store';
import appConfig, { Config } from './config';
@ -131,7 +128,11 @@ class Application {
private displayApp(): void {
ReactDOM.render(
<App store={this.store} history={this.history} />,
<Provider store={this.store}>
<ConnectedRouter history={this.history}>
<App />
</ConnectedRouter>
</Provider>,
this.container,
);
}

View File

@ -1,8 +1,5 @@
import * as React from 'react';
import { History } from 'history';
import { Provider, Store } from 'react-redux';
import { Route, Switch } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import AccountLayout from './layout/AccountLayout';
import AppLayout from './layout/AppLayout';
@ -10,8 +7,6 @@ import AppLayout from './layout/AppLayout';
import TempLayout from './layout/TempLayout';
export interface Props {
store: Store<any>;
history: History;
}
export interface State {
}
@ -24,15 +19,11 @@ class App extends React.Component<Props, State> {
public render(): JSX.Element {
return (
<Provider store={this.props.store}>
<ConnectedRouter history={this.props.history}>
<Switch>
<Route path='/temp' component={TempLayout}/>
<Route path='/account' component={AccountLayout}/>
<Route path='/' component={AppLayout}/>
</Switch>
</ConnectedRouter>
</Provider>
<Switch>
<Route path='/temp' component={TempLayout}/>
<Route path='/account' component={AccountLayout}/>
<Route path='/' component={AppLayout}/>
</Switch>
);
}
}