MCPcopy Create free account
hub / github.com/Lobos/react-ui / traverseEnterLeave

Function traverseEnterLeave

docs/lib/react.js:9033–9052  ·  view source on GitHub ↗

* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that * should would receive a `mouseEnter` or `mouseLeave` event. * * Does not invoke the callback on the nearest common ancestor because nothing * "entered" or "left" that element.

(from, to, fn, argFrom, argTo)

Source from the content-addressed store, hash-verified

9031 * "entered" or "left" that element.
9032 */
9033function traverseEnterLeave(from, to, fn, argFrom, argTo) {
9034 var common = from && to ? getLowestCommonAncestor(from, to) : null;
9035 var pathFrom = [];
9036 while (from && from !== common) {
9037 pathFrom.push(from);
9038 from = from._nativeParent;
9039 }
9040 var pathTo = [];
9041 while (to && to !== common) {
9042 pathTo.push(to);
9043 to = to._nativeParent;
9044 }
9045 var i;
9046 for (i = 0; i < pathFrom.length; i++) {
9047 fn(pathFrom[i], true, argFrom);
9048 }
9049 for (i = pathTo.length; i-- > 0;) {
9050 fn(pathTo[i], false, argTo);
9051 }
9052}
9053
9054module.exports = {
9055 isAncestor: isAncestor,

Callers

nothing calls this directly

Calls 1

getLowestCommonAncestorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…