@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.
24 lines • 1.31 kB
TypeScript
import { type ReactNode } from 'react';
import type { NodeInstance } from '../types/node.type.js';
/**
* `MeoNodeUnmounter` is a client-side React component responsible for performing cleanup
* operations when a `MeoNode` instance is unmounted from the React tree.
*
* It leverages `useEffectEvent` to create a stable cleanup function that is called
* when the component unmounts. This cleanup function performs the following actions:
* - Deletes the node from `BaseNode.elementCache` using its `stableKey`.
* - Untracks the node's mount status via `MountTrackerUtil.untrackMount`.
* - Unregisters the node from `BaseNode.cacheCleanupRegistry` to prevent redundant
* finalization callbacks.
* - Clears the `lastSignature` of the associated `BaseNode` instance to help prevent
* memory leaks from retained prop objects.
* @param {object} props The component's props.
* @param {NodeInstance} props.node The BaseNode instance associated with this component.
* @param {ReactNode} [props.children] The children to be rendered by this component.
* @returns {ReactNode} The `children` passed to the component.
*/
export default function MeoNodeUnmounter({ children, ...props }: {
node: NodeInstance;
children?: ReactNode;
}): ReactNode;
//# sourceMappingURL=meonode-unmounter.client.d.ts.map