Fix hot-reloading breaking react-router-dom

This commit is contained in:
Matthew Penner 2020-12-28 11:10:01 -07:00
parent dbb6f69e00
commit b19406bf22
2 changed files with 4 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import ProgressBar from '@/components/elements/ProgressBar';
import NotFound from '@/components/screens/NotFound'; import NotFound from '@/components/screens/NotFound';
import tw, { GlobalStyles as TailwindGlobalStyles } from 'twin.macro'; import tw, { GlobalStyles as TailwindGlobalStyles } from 'twin.macro';
import GlobalStylesheet from '@/assets/css/GlobalStylesheet'; import GlobalStylesheet from '@/assets/css/GlobalStylesheet';
import { createBrowserHistory } from 'history'; import { history } from '@/components/history';
import { setupInterceptors } from '@/api/interceptors'; import { setupInterceptors } from '@/api/interceptors';
interface ExtendedWindow extends Window { interface ExtendedWindow extends Window {
@ -31,8 +31,6 @@ interface ExtendedWindow extends Window {
}; };
} }
const history = createBrowserHistory({ basename: '/' });
setupInterceptors(history); setupInterceptors(history);
const Pageview = () => { const Pageview = () => {

View file

@ -0,0 +1,3 @@
import { createBrowserHistory } from 'history';
export const history = createBrowserHistory({ basename: '/' });