@c15t/react
Version:
Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization
14 lines • 875 B
TypeScript
import { type ReactNode } from 'react';
/**
* Recursively clones React children, adding additional props to components with matched display names.
*
* @param children - The node(s) to be cloned.
* @param additionalProps - The props to add to the matched components.
* @param displayNames - An array of display names to match components against.
* @param uniqueId - A unique ID prefix from the parent component to generate stable keys.
* @param asChild - Indicates whether the parent component uses the Slot component.
*
* @returns The cloned node(s) with the additional props applied to the matched components.
*/
export declare function recursiveCloneChildren(children: ReactNode, additionalProps: Record<string, unknown>, displayNames: string[], uniqueId: string, asChild?: boolean): ReactNode | ReactNode[];
//# sourceMappingURL=recursive-clone-children.d.ts.map