I’m trying to create a basic private route that is void of role permissions and restrictions at the moment and when I use the syntax that I got from the documentation from react router Dom it states the error above when trying to go to the private route. ( A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .)
PrivateRoute Component
Routes
Tried using the direct code from react-router-dom’s docs and made sure that the localStorage is storing an ID on login.
teagankeith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.