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

Function wrapUpdate

starters/docs/src/Toast.tsx:26–34  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

fnFunction · 0.85
startViewTransitionMethod · 0.80

Tested by

no test coverage detected