To Fix Error: [PrivateRoute] is not a component. All component children of must be a or Error just set your router component. To solve this error you have to just set your router component to element prop as you can see in the below code. So just set your router component and your error will be solved. Thank you! <Routes> <Route exact path="/" element={<Home />} /> <Route path="/about" element={<About />} /> <Route path="/dashboard" element={<Dashboard />} /> </Routes