@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) • 580 B
JavaScript
"use client";
import{useEffectEvent as e,useEffect as t,isValidElement as r,cloneElement as a}from"react";import{MountTrackerUtil as n}from"../util/mount-tracker.util.js";import{BaseNode as o}from"../core.node.js";function l({children:l,...s}){const{node:c,...i}=s,u=e(()=>{if(c.stableKey){o.elementCache.delete(c.stableKey),n.isMounted(c.stableKey)&&n.untrackMount(c.stableKey);try{o.cacheCleanupRegistry.unregister(c)}catch{}}c.lastSignature=void 0});return t(()=>(c.stableKey&&n.trackMount(c.stableKey),()=>u()),[]),r(l)&&Object.keys(i).length>0?a(l,i):l}export{l as default};