Is there a 'useTransition' React hook equivalent in Solid?
From what I understand, useTransition for managing concurrent rendering, where you want to prioritise rendering some UI or others.
Can we achieve a similar effect in Solidjs?
2 Replies
Solid has a similar primitive
https://docs.solidjs.com/reference/reactive-utilities/use-transition
Keep in mind that Solid's
useTransition
isn't about “prioritizing” UI rendering but rendering the future view in the background, disconnected from the DOM while keeping the “stale” DOM view in place, implementing paint holding.
So rather than replacing stale content with a loading spinner/skeleton, the loading action is communicated to the user via an application level loading indicator while the stale content remains in place until such time that it can be replaced by the newly rendered content.
So while in React one transition can interrupt another one that is in progress, in Solid a transition triggers the containing suspense boundary and remains “pending” until all promises under that suspense boundary have settled.Chrome for Developers
Paint Holding - reducing the flash of white on same-origin navigati...
A quick overview of paint holding. A Chrome feature for reducing the flash of white on same-origin navigations