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:
parent
f8c54a6827
commit
02d6a57e02
@ -81,7 +81,7 @@ export const App = () => {
|
|||||||
<EnvironmentSplash onFinish={refetchSplash} />
|
<EnvironmentSplash onFinish={refetchSplash} />
|
||||||
}
|
}
|
||||||
elseShow={
|
elseShow={
|
||||||
<LayoutPicker location={location}>
|
<LayoutPicker>
|
||||||
<Switch>
|
<Switch>
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
exact
|
exact
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import ConditionallyRender from '../../common/ConditionallyRender';
|
import ConditionallyRender from '../../common/ConditionallyRender';
|
||||||
import { matchPath } from 'react-router';
|
import { matchPath } from 'react-router';
|
||||||
|
import { useLocation } from 'react-router-dom';
|
||||||
import { MainLayout } from '../MainLayout/MainLayout';
|
import { MainLayout } from '../MainLayout/MainLayout';
|
||||||
|
|
||||||
const LayoutPicker = ({ children, location }) => {
|
const LayoutPicker = ({ children }) => {
|
||||||
|
const location = useLocation();
|
||||||
const standalonePages = () => {
|
const standalonePages = () => {
|
||||||
const { pathname } = location;
|
const { pathname } = location;
|
||||||
const isLoginPage = matchPath(pathname, { path: '/login' });
|
const isLoginPage = matchPath(pathname, { path: '/login' });
|
||||||
|
Loading…
Reference in New Issue
Block a user