DEV Community 👩‍💻👨‍💻

Discussion on: Protected Routes with React Function Components

sevenzark profile image
Dave M • Edited on

Unfortunately when I try this approach and hit the protected route, I get a show-stopping error: 'Invariant failed: You should not use <Route> outside a <Router>'. Seems like it doesn't like me composing something around the Route component, but I don't know why you and I get different results for that.