const authToken = Cookies.get("authToken");
return (
<Route
{...rest}
render={props =>
authToken ? (
<Component {...props} />
) : (
<Redirect
to={{
pathname: AUTHENTICATION_LOGIN_PATH,
}}
/>
)
}
/>
);
};
try something like this
Unfortunately, its still the same error.
This error arise only when you are using your component ProtectedRoute ?
Обсуждают сегодня