Skip to content

Component

Anton edited this page Aug 6, 2019 · 10 revisions

Component is a class that allows to implement advanced rendering operations.

Component: Preact component.

Name Type & Description
static getDerivedStateFromProps (props: !Object, state: !Object) => Object
The function to compute the state from properties.
static defaultProps !Object
Properties that will be assigned upon construction of the component.
render* (props?: !Object, state?: !Object, context?: !Object) => VNode
props* !Object
The properties.
state* !Object
The state.
_disable
__x
boolean
Turns off stateful re-rendering.
setState* (state: !Object, callback?: function(): void) => void
forceUpdate* (callback?: function(): void) => void
context* !Object
The context.
componentWillMount* () => void
componentDidMount* () => void
componentWillUnmount* () => void
getChildContext* () => Object
componentWillReceiveProps* (nextProps?: !Object, nextContext?: !Object) => void
shouldComponentUpdate* (nextProps?: !Object, nextState?: !Object, nextContext?: !Object) => boolean
componentWillUpdate* (nextProps?: !Object, nextState?: !Object, nextContext?: !Object) => void
componentDidUpdate* (prevProps?: !Object, prevState?: !Object, prevContext?: !Object) => void
Clone this wiki locally