Create a fallback for lazy routes #10540
ryan-saffer
started this conversation in
Proposals
Replies: 1 comment 8 replies
-
It's a UX decision at the end of the day
I personally prefer the latter to continue showing the user content during loading instead of flipping them to skeletons |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Since the release of a
lazy
route in 6.9, there is no way to provide a fallback component to display while the route is being loaded.It seems the only way to provide one would be to not use react-routers
lazy
property, but instead useReact.lazy
to wrap ourelement
in aReact.Suspense
. Without the ability to do this using react-routerslazy
property, I don't really see a benefit to using it overReact.lazy
?Using react-router-dom
Using
React.Suspense
Could anyone help me understand why I would use the first example instead of the second?
Beta Was this translation helpful? Give feedback.
All reactions