Conditionally render a component with new data-api routers #9872
Unanswered
yusuphgammut
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi reaact-router team. Potentially dumb question here.
Before the new data-api routers I was doing conditional rendering of components as usual in React:
However, I'm upgrading the routes to the new recommended static route definition for data-api routers, but now I'm not sure how to perform the conditional rendering shown above, since the new routes are statically defined. For now I've managed to solve it using a redirect from loader like this:
Is this the expected way to migrate in this case or is there a better way to do it?
Beta Was this translation helpful? Give feedback.
All reactions