All component children of <Routes> must be a <Route> or <React.Fragment> #121137
Unanswered
startthecode
asked this question in
Programming Help
Replies: 2 comments
-
I think you need to wrap routes in the fragment into the return |
Beta Was this translation helpful? Give feedback.
0 replies
-
an example for you, that could work. ofc you would change and add your own path. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Hello all,
export const RbacRoute = ({ element: OriginalComponent, path, routeName }) => {
let { userRole, permitedRoutes } = useContext(UserContext());
return ()=>;
};
Uncaught Error: [RbacRoute] is not a component. All component children of must be a or <React.Fragment>
I want to return Routes with some modifications for role-based routes, but this component throws an error as mentioned above.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions