mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-26 01:35:16 +00:00
* accept hot module changes, move routes into root component * Fix "You cannot change <Router routes>; it will be ignored" error message by implementing solution in Github: https://github.com/ReactTraining/react-router/issues/2704#issuecomment-211352123 Router is only instantiated once in a production setting (e.g. not webpack-dev-server), so there is minimal overhead on producing a random key value for `Router`.
10 lines
232 B
JavaScript
10 lines
232 B
JavaScript
import { browserHistory } from 'react-router';
|
|
import { useBasename } from 'history';
|
|
|
|
export const history = getHistory();
|
|
|
|
function getHistory() {
|
|
const basename = '';
|
|
return useBasename(() => browserHistory)({ basename });
|
|
}
|