Class Component<P, S>Abstract
Constructors
constructor
- new Component<P, S>(props?: P, context?: any): Component<P, S>
-
Parameters
-
Optional
props: P
-
Optional
context: any
Properties
Optional
base
base?: Element | Text
context
context: any
props
state
Static
Optional
contextType
Static
Optional
defaultProps
defaultProps?: any
Static
Optional
displayName
displayName?: string
Methods
Optional
componentDidCatch
- componentDidCatch(error: any, errorInfo: ErrorInfo): void
-
Returns void
Optional
componentDidMount
- componentDidMount(): void
-
Returns void
Optional
componentDidUpdate
- componentDidUpdate(previousProps: Readonly<P>, previousState: Readonly<S>, snapshot: any): void
-
Returns void
Optional
componentWillMount
- componentWillMount(): void
-
Returns void
Optional
componentWillReceiveProps
- componentWillReceiveProps(nextProps: Readonly<P>, nextContext: any): void
-
Returns void
Optional
componentWillUnmount
- componentWillUnmount(): void
-
Returns void
Optional
componentWillUpdate
- componentWillUpdate(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void
-
Returns void
forceUpdate
- forceUpdate(callback?: (() => void)): void
-
Parameters
-
Optional
callback: (() => void)
Returns void
Optional
getChildContext
- getChildContext(): object
-
Returns object
Optional
getSnapshotBeforeUpdate
- getSnapshotBeforeUpdate(oldProps: Readonly<P>, oldState: Readonly<S>): any
-
Returns any
setState
- setState<K>(state: null | Partial<S> | Pick<S, K> | ((prevState: Readonly<S>, props: Readonly<P>) => null | Partial<S> | Pick<S, K>), callback?: (() => void)): void
-
Type Parameters
-
K extends string | number | symbol
Returns void
Optional
shouldComponentUpdate
- shouldComponentUpdate(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean
-
Returns boolean
Static
Optional
getDerivedStateFromError
- getDerivedStateFromError(error: any): null | object
-
Returns null | object
Static
Optional
getDerivedStateFromProps
- getDerivedStateFromProps(props: object, state: object): null | object
-
Parameters
-
props: object
-
state: object
Returns null | object