React Authentication Context being null initially
问题 I'm using React contexts in order to hold my authentication state for my application. Currently, I'm having an issue where whenever I try and hit /groups/:id , it always redirects me to /login first and then to /UserDash . This is happening because the context of my AuthProvider isn't updating fast enough, and my Private Route utilized the AuthContext to decide whether to redirect or not. <AuthProvider> <Router> <Switch> <LoggedRoute exact path = "/" component = {Home}/> <Route exact path = "