Modify Suspense Config to Avoid a Flash of Loading State

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

This video uses an experimental API that has been changed. useTransition no longer accepts a SUSPENSE_CONFIG. Learn more.

By improving the loading experience for users with fast connections, we actually made the experience worse for people with slower connections using two additional configuration options busyDelayMs and busyMinDurationMs allowing us to communicate with React: "If the busy time takes at least x milliseconds, then show the busy state for at least y milliseconds."

Viktor Soroka
~ 5 years ago

In the end, there is a combination of CSS transition with the config to the useTransition. It would be handy to have just another option in the config in order to avoid having in mind CSS stuff IMO.