;
+ getDerivedStateFromProps?(
+ props: Readonly,
+ state: Readonly,
+ ): Partial | null;
+ getDerivedStateFromError?(error: any): Partial | null;
}
export interface Component
{
- componentWillMount?(): void;
- componentDidMount?(): void;
- componentWillUnmount?(): void;
- getChildContext?(): object;
- componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
- shouldComponentUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): boolean;
- componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
- getSnapshotBeforeUpdate?(oldProps: Readonly
, oldState: Readonly): any;
- componentDidUpdate?(previousProps: Readonly
, previousState: Readonly, snapshot: any): void;
- componentDidCatch?(error: any, errorInfo: ErrorInfo): void;
+ componentWillMount?(): void;
+ componentDidMount?(): void;
+ componentWillUnmount?(): void;
+ getChildContext?(): object;
+ componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
+ shouldComponentUpdate?(
+ nextProps: Readonly
,
+ nextState: Readonly,
+ nextContext: any,
+ ): boolean;
+ componentWillUpdate?(
+ nextProps: Readonly
,
+ nextState: Readonly,
+ nextContext: any,
+ ): void;
+ getSnapshotBeforeUpdate?(oldProps: Readonly
, oldState: Readonly): any;
+ componentDidUpdate?(
+ previousProps: Readonly
,
+ previousState: Readonly,
+ snapshot: any,
+ ): void;
+ componentDidCatch?(error: any, errorInfo: ErrorInfo): void;
}
declare abstract class Component
{
- constructor(props?: P, context?: any);
- static displayName?: string;
- static defaultProps?: any;
- static contextType?: Context;
- // Static members cannot reference class type parameters. This is not
- // supported in TypeScript. Reusing the same type arguments from `Component`
- // will lead to an impossible state where one cannot satisfy the type
- // constraint under no circumstances, see #1356.In general type arguments
- // seem to be a bit buggy and not supported well at the time of this
- // writing with TS 3.3.3333.
- static getDerivedStateFromProps?(props: Readonly