UNPKG

@meonode/ui

Version:

A structured approach to component composition, direct CSS-first prop styling, built-in theming, smart prop handling (including raw property pass-through), and dynamic children.

3 lines (2 loc) 661 B
"use client"; "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../util/mount-tracker.util.cjs"),r=require("../core.node.cjs");exports.default=function({children:a,...n}){const{node:c,...l}=n,s=e.useEffectEvent(()=>{if(c.stableKey){r.BaseNode.elementCache.delete(c.stableKey),t.MountTrackerUtil.isMounted(c.stableKey)&&t.MountTrackerUtil.untrackMount(c.stableKey);try{r.BaseNode.cacheCleanupRegistry.unregister(c)}catch{}}c.lastSignature=void 0});return e.useEffect(()=>(c.stableKey&&t.MountTrackerUtil.trackMount(c.stableKey),()=>s()),[]),e.isValidElement(a)&&Object.keys(l).length>0?e.cloneElement(a,l):a};