@serenity-is/corelib / Component
Class: Component<T>
Defined in: ../domwise/dist/index.d.ts:2463
Base class for class-based JSX components.
Extend this class and override render to return a JSXElement.
Props (including optional children and ref) are available via props.
Example
class Greeting extends Component<{ name: string }> {
render() {
return <div>Hello, {this.props.name}!</div>;
}
}
// usage: <Greeting name="World" />
Type Parameters
T
T = any
The type of the component's props (excluding children and ref which are added automatically).
Constructors
Constructor
new Component<
T>(props):Component<T>
Defined in: ../domwise/dist/index.d.ts:2473
Creates a component instance.
Parameters
props
T & object
Props passed to the component, including optional children and ref.
Returns
Component<T>
Properties
props
readonlyprops:T&object
Defined in: ../domwise/dist/index.d.ts:2478
Props passed to this component instance, including optional children and ref.
Type Declaration
children?
optionalchildren:ComponentChildren
ref?
optionalref:Ref<any>
isComponent
staticisComponent:boolean
Defined in: ../domwise/dist/index.d.ts:2468
Marker used by the JSX factory to distinguish class components from function components. Do not modify.
Methods
render()
render():
JSXElement
Defined in: ../domwise/dist/index.d.ts:2487
Renders the component's output.
Override in subclasses to return a DOM node, fragment, or null.
Returns
The rendered JSXElement, or null to render nothing.