Skip to content

Commit

Permalink
fix(protectedroute): updated conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Oct 17, 2022
1 parent 63b2464 commit 22e3396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routing/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ export const ProtectedRoute = ({
...rest
}: RouteProps): JSX.Element => {
const { displayedName } = useLoginContext()

if (displayedName && children) {
return <Route {...rest}>{children}</Route>
}

if (WrappedComponent) {
if (displayedName && WrappedComponent) {
return (
<Route
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down

0 comments on commit 22e3396

Please sign in to comment.