MCPcopy Create free account
hub / github.com/adobe/react-spectrum / wrapUpdate

Function wrapUpdate

starters/tailwind/src/Toast.tsx:27–35  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

25export const queue = new ToastQueue<MyToastContent>({
26 // Wrap state updates in a CSS view transition.
27 wrapUpdate(fn) {
28 if ('startViewTransition' in document) {
29 document.startViewTransition(() => {
30 flushSync(fn);
31 });
32 } else {
33 fn();
34 }
35 }
36});
37
38export function MyToastRegion() {

Callers

nothing calls this directly

Calls 2

fnFunction · 0.85
startViewTransitionMethod · 0.80

Tested by

no test coverage detected