Closed YM-KA closed 5 years ago
You are not passing a function to your render prop. Try the following instead:
{ CategoryLocation.toRoute({ render: () => privateLocation(isAuthenticated, MyComponent), invalid: NotFoundPage }, true) }
Thank you for the prompt reply, what a basic error! Many thanks for pointing it out to me! (^__^)/
I'm refactoring code to be DRY by using react-app-link to handle routes. For public routes this woks like a charm! But most of my routes are protected and I am having trouble protecting my routes when using MyLocation.toRoute({render}).
When trying to protect the route I get a lot of cryptic error messages. Unfortunately the ract-app-link documentation has no examples for the renderOptions "render" .
I expect the component to render, but receive the error "TypeError: _render is not a function"