跳到主要内容
版本:0.9.0-beta.2

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

src/react/component.ts:32


getState

getState(): S

Get the Component state

Returns

S

Defined in

src/react/component.ts:36


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

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

Returns

void

Defined in

src/react/component.ts:24


removeOnUpdateState

removeOnUpdateState(): void

Remove the Component update event listening

Returns

void

Defined in

src/react/component.ts:28


render

render(nextState?): void

Trigger the Component update event

Parameters

NameType
nextState?S

Returns

void

Defined in

src/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

src/react/component.ts:14