I am trying to redirect if to the login screen if the user is not logged in. I implemented a private route to handle this functionality as follows
import Reac