MCPcopy Index your code
hub / github.com/react/create-react-app / traverseTwoPhase

Function traverseTwoPhase

packages/react-error-overlay/fixtures/bundle.mjs:33285–33298  ·  view source on GitHub ↗

* Simulates the traversal of a two-phase, capture/bubble event dispatch.

(inst, fn, arg)

Source from the content-addressed store, hash-verified

33283 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
33284 */
33285function traverseTwoPhase(inst, fn, arg) {
33286 var path = [];
33287 while (inst) {
33288 path.push(inst);
33289 inst = inst._hostParent;
33290 }
33291 var i;
33292 for (i = path.length; i-- > 0;) {
33293 fn(path[i], 'captured', arg);
33294 }
33295 for (i = 0; i < path.length; i++) {
33296 fn(path[i], 'bubbled', arg);
33297 }
33298}
33299
33300/**
33301 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that

Callers

nothing calls this directly

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected