()
| 4614 | }; |
| 4615 | |
| 4616 | function 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 | |
| 4630 | function requestFormReset(form: HTMLFormElement) { |
| 4631 | const formInst = getInstanceFromNodeDOMTree(form); |
no test coverage detected