Skip to main content
Version: 1.x

Interface: IComponent<S>

molecule.react.IComponent

Type parameters

NameType
Sany

Implemented by

Methods

forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Defined in

react/component.ts:33


getState

getState(): S

Get the Component state

Returns

S

Defined in

react/component.ts:37


onUpdateState

onUpdateState(listener): void

Listen to the Component state update event

Parameters

NameType
listener(prevState: S, nextState: S) => void

Returns

void

Defined in

react/component.ts:24


removeOnUpdateState

removeOnUpdateState(listener?): void

Remove the Component update event listening, default is remove all, also you can remove one by pass the listener

Parameters

NameType
listener?Function

Returns

void

Defined in

react/component.ts:29


render

render(nextState?): void

Trigger the Component update event

Parameters

NameType
nextState?S

Returns

void

Defined in

react/component.ts:19


setState

setState(values, callback?): void

Set the Component state

Parameters

NameTypeDescription
valuesSThe next values of state
callback?(prevState: S, nextState: S) => voidcalling after setState

Returns

void

Defined in

react/component.ts:14