* Flush custom event dispatch * https://github.com/radix-ui/primitives/pull/1378 * * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. * * Internally, React prioritises events in the following order: * - discrete * - c
(target: E['target'], event: E)
| 98 | */ |
| 99 | |
| 100 | function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) { |
| 101 | if (target) ReactDOM.flushSync(() => target.dispatchEvent(event)) |
| 102 | } |
| 103 | |
| 104 | /* -----------------------------------------------------------------------------------------------*/ |
| 105 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…