MCPcopy Index your code
hub / github.com/react/react / flushSyncWork

Function flushSyncWork

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js:4616–4628  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4614};
4615
4616function flushSyncWork() {
4617 if (disableLegacyMode) {
4618 const previousWasRendering = previousDispatcher.f(); /* flushSyncWork */
4619 const wasRendering = flushSyncWorkOnAllRoots();
4620 // Since multiple dispatchers can flush sync work during a single flushSync call
4621 // we need to return true if any of them were rendering.
4622 return previousWasRendering || wasRendering;
4623 } else {
4624 throw new Error(
4625 'flushSyncWork should not be called from builds that support legacy mode. This is a bug in React.',
4626 );
4627 }
4628}
4629
4630function requestFormReset(form: HTMLFormElement) {
4631 const formInst = getInstanceFromNodeDOMTree(form);

Callers 4

finishEventHandlerFunction · 0.50
unmountComponentAtNodeFunction · 0.50
ReactDOMRoot.jsFile · 0.50

Calls 1

flushSyncWorkOnAllRootsFunction · 0.85

Tested by

no test coverage detected