For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/react/Function.cloneElement.md.
  • English
  • @lynx-js/react / cloneElement

    Function: cloneElement()

    cloneElement(element, props, children)

    function cloneElement<P, T>(
       element: DetailedReactHTMLElement<P, T>, 
       props?: P, ...
    children?: ReactNode[]): DetailedReactHTMLElement<P, T>

    Type Parameters

    Type Parameter
    P extends HTMLAttributes<T, P>
    T extends HTMLElement<T>

    Parameters

    ParameterType
    elementDetailedReactHTMLElement<P, T>
    props?P
    ...children?ReactNode[]

    Returns

    DetailedReactHTMLElement<P, T>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:571

    cloneElement(element, props, children)

    function cloneElement<P, T>(
       element: ReactHTMLElement<T>, 
       props?: P, ...
    children?: ReactNode[]): ReactHTMLElement<T>

    Type Parameters

    Type Parameter
    P extends HTMLAttributes<T, P>
    T extends HTMLElement<T>

    Parameters

    ParameterType
    elementReactHTMLElement<T>
    props?P
    ...children?ReactNode[]

    Returns

    ReactHTMLElement<T>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:577

    cloneElement(element, props, children)

    function cloneElement<P, T>(
       element: ReactSVGElement, 
       props?: P, ...
       children?: ReactNode[]): ReactSVGElement

    Type Parameters

    Type Parameter
    P extends SVGAttributes<T, P>
    T extends SVGElement<T>

    Parameters

    ParameterType
    elementReactSVGElement
    props?P
    ...children?ReactNode[]

    Returns

    ReactSVGElement

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:583

    cloneElement(element, props, children)

    function cloneElement<P, T>(
       element: DOMElement<P, T>, 
       props?: DOMAttributes<T> & P, ...
    children?: ReactNode[]): DOMElement<P, T>

    Type Parameters

    Type Parameter
    P extends DOMAttributes<T, P>
    T extends Element<T>

    Parameters

    ParameterType
    elementDOMElement<P, T>
    props?DOMAttributes<T> & P
    ...children?ReactNode[]

    Returns

    DOMElement<P, T>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:589

    cloneElement(element, props, children)

    function cloneElement<P>(
       element: FunctionComponentElement<P>, 
       props?: Partial<P> & Attributes, ...
    children?: ReactNode[]): FunctionComponentElement<P>

    Type Parameters

    Type Parameter
    P

    Parameters

    ParameterType
    elementFunctionComponentElement<P>
    props?Partial<P> & Attributes
    ...children?ReactNode[]

    Returns

    FunctionComponentElement<P>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:596

    cloneElement(element, props, children)

    function cloneElement<P, T>(
       element: CElement<P, T>, 
       props?: Partial<P> & ClassAttributes<T>, ...
    children?: ReactNode[]): CElement<P, T>

    Type Parameters

    Type Parameter
    P
    T extends Component<P, any, any, T>

    Parameters

    ParameterType
    elementCElement<P, T>
    props?Partial<P> & ClassAttributes<T>
    ...children?ReactNode[]

    Returns

    CElement<P, T>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:601

    cloneElement(element, props, children)

    function cloneElement<P>(
       element: ReactElement<P, string | JSXElementConstructor<any>>, 
       props?: Partial<P> & Attributes, ...
    children?: ReactNode[]): ReactElement<P>

    Type Parameters

    Type Parameter
    P

    Parameters

    ParameterType
    elementReactElement<P, string | JSXElementConstructor<any>>
    props?Partial<P> & Attributes
    ...children?ReactNode[]

    Returns

    ReactElement<P>

    Defined in

    .pnpm/@types+react@18.3.28/node_modules/@types/react/ts5.0/index.d.ts:606

    Example

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.