I have a react router with 5 pages, and check in 4 of them if I have a user logged in so that whether he is redirected, or displays the component.
It works perfectly