Closed sysmat closed 3 years ago
Something very similar to what you're describing is already possible with a couple of helper components. Checkout the private routes example as a starting point. You could pass a check function and a redirect target (if you should need that) to the protected route as props.
I hope this works for your use case.
Is your feature request related to a problem? Please describe.
To have guarded some routes(admin, user, ...) something like angular router, so function which determines if the route can be activeted
Describe the solution you'd like
Describe alternatives you've considered