1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

fix: useLocation from react-router (#706)

This commit is contained in:
Fredrik Strand Oseberg 2022-02-14 12:32:55 +01:00 committed by GitHub
parent f8c54a6827
commit 02d6a57e02
2 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,7 @@ export const App = () => {
<EnvironmentSplash onFinish={refetchSplash} />
}
elseShow={
<LayoutPicker location={location}>
<LayoutPicker>
<Switch>
<ProtectedRoute
exact

View File

@ -1,8 +1,10 @@
import ConditionallyRender from '../../common/ConditionallyRender';
import { matchPath } from 'react-router';
import { useLocation } from 'react-router-dom';
import { MainLayout } from '../MainLayout/MainLayout';
const LayoutPicker = ({ children, location }) => {
const LayoutPicker = ({ children }) => {
const location = useLocation();
const standalonePages = () => {
const { pathname } = location;
const isLoginPage = matchPath(pathname, { path: '/login' });