-
Notifications
You must be signed in to change notification settings - Fork 1
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 |
Most of documentation comes from Preact authors, for example https://preactjs.com/guide/api-reference.
The externs were created to be used with JavaScript Compiler: https://compiler.page.
![]() |
© Art Deco™ for Depack 2020 |
---|