MCPcopy
hub / github.com/facebook/react / hideOnClick

Function hideOnClick

packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.js:561–566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

559 function OldApp() {
560 const [value, setValue] = React.useState('old');
561 function hideOnClick() {
562 // Schedule a discrete update.
563 setValue('update');
564 // Synchronously unmount this root.
565 ReactDOM.flushSync(() => oldRoot.unmount());
566 }
567 return (
568 <button onClick={hideOnClick} ref={ref}>
569 {value}

Callers

nothing calls this directly

Calls 1

setValueFunction · 0.85

Tested by

no test coverage detected