"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../utils/owner.js"),t=require("./use-iso-morphic-effect.js");exports.useTreeWalker=function(c,u){let{container:s,accept:n,walk:o}=u,i=e.useRef(n),f=e.useRef(o);e.useEffect((()=>{i.current=n,f.current=o}),[n,o]),t.useIsoMorphicEffect((()=>{if(!s||!c)return;let e=r.getOwnerDocument(s);if(!e)return;let t=i.current,u=f.current,n=Object.assign((e=>t(e)),{acceptNode:t}),o=e.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,n,!1);for(;o.nextNode();)u(o.currentNode)}),[s,c,i,f])};
//# sourceMappingURL=use-tree-walker.js.map
