@orca-fe/pocket
Version:
UI components by orca-team
51 lines (50 loc) • 2.97 kB
TypeScript
import React from 'react';
export default function shouldUpdate<Props>(Comp: React.ComponentClass<Props> | React.FunctionComponent<Props>, shouldComponentUpdateFn: (props: Props, prevProps: Props) => boolean): {
new (props: Props): {
shouldComponentUpdate(nextProps: Readonly<Props>): boolean;
render(): import("react/jsx-runtime").JSX.Element;
context: unknown;
setState<K extends never>(state: unknown, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props>;
state: Readonly<unknown>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<unknown>): any;
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<unknown>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<unknown>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<unknown>, nextContext: any): void;
};
new (props: Props, context: any): {
shouldComponentUpdate(nextProps: Readonly<Props>): boolean;
render(): import("react/jsx-runtime").JSX.Element;
context: unknown;
setState<K extends never>(state: unknown, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props>;
state: Readonly<unknown>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<unknown>): any;
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<unknown>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<unknown>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<unknown>, nextContext: any): void;
};
contextType?: React.Context<any> | undefined;
};