Interface FunctionComponentElement<P>

Represents a JSX element.

Where ReactNode represents everything that can be rendered, ReactElement only represents JSX.

Example

const element: ReactElement = <div />;
interface FunctionComponentElement<P> {
    key: string;
    props: P;
    ref?: "ref" extends keyof P
        ? P extends {
                ref?: R;
            }
            ? R
            : never
        : never;
    type: FunctionComponent<P>;
}

Type Parameters

  • P

    The type of the props object

Hierarchy (view full)

Properties

Properties

key: string
props: P
ref?: "ref" extends keyof P
    ? P extends {
            ref?: R;
        }
        ? R
        : never
    : never