Goal: Wrap React Router's Route component so I can avoid having to wrap 50+...


Goal: Wrap React Router's Route component so I can avoid having to wrap 50+ lazy loaded routes in Suspense.

This doesn't work because React Router only allows the "Route" component to be a child of Routes.

Is there a better way to handle this?

cc @ryanflorence

@ryanflorence Follow up: Here's 2 solid options. Credit to @ryanflorence and @MuyiwaMighty for these ideas:

View original on X