#117: scroll to top on route transition

This commit is contained in:
SleepWalker 2016-05-31 07:25:39 +03:00
parent d9f0d61297
commit cbf0fc979e

View File

@ -1,5 +1,5 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import { Route, IndexRoute, browserHistory } from 'react-router';
import RootPage from 'pages/root/RootPage';
import IndexPage from 'pages/index/IndexPage';
@ -26,6 +26,11 @@ import Finish from 'components/auth/finish/Finish';
import authFlow from 'services/authFlow';
browserHistory.listen(() => {
// scroll to top on route transition
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
export default function routesFactory(store) {
authFlow.setStore(store);