Does anyone know how to restrict access to particular routes in react-router? I want to check if the user is logged in before allowing access to a particular route. I though
You can use HOC and auth is a variable you can change value true or false means(authorization)
(auth ? () : ())}/>