Skip to content

@serenity-is/domwise / ComponentClass

Interface: ComponentClass<P, T>

Defined in: types/components.d.ts:10

A class-based JSX component. Extend Component or implement this interface and override render to return a JSXElement.

Type Parameters

P

P = { }

The type of the component's props.

T

T extends Node = JSXElement

The type of the DOM node the component renders.

Constructors

Constructor

new ComponentClass(props): ComponentClass<P, T>

Defined in: types/components.d.ts:15

Constructs the component with the given props.

Parameters

props

P

Props including optional children.

Returns

ComponentClass<P, T>

Properties

defaultProps?

optional defaultProps: Partial<P>

Defined in: types/components.d.ts:22

Optional default prop values merged in by the JSX factory before construction.


displayName?

optional displayName: string

Defined in: types/components.d.ts:26

Optional display name used in devtools / error messages.


props?

readonly optional props: P & object

Defined in: types/components.d.ts:24

Props passed to the instance, including optional children.

Type Declaration

children?

optional children: ComponentChildren

Methods

render()

render(): JSXElement | null

Defined in: types/components.d.ts:20

Renders the component.

Returns

JSXElement | null

The rendered JSXElement or null.