Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Component

interface Component <P = {}, S = {}> {
componentDidCatch?(error: any, errorInfo: ErrorInfo): void;
componentDidMount?(): void;
componentDidUpdate?(
previousProps: Readonly<P>,
previousState: Readonly<S>,
snapshot: any,
): void;
componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
componentWillUnmount?(): void;
componentWillUpdate?(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): void;
getChildContext?(): object;
getSnapshotBeforeUpdate?(oldProps: Readonly<P>, oldState: Readonly<S>): any;
shouldComponentUpdate?(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): boolean;
}
abstract class Component<P, S> {
constructor(props?: P, context?: any);
base?: Element | Text;
context: any;
props: RenderableProps<P>;
state: Readonly<S>;
 
forceUpdate(callback?: () => void): void;
abstract render(
props?: RenderableProps<P>,
state?: Readonly<S>,
context?: any,
): ComponentChild;
setState<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => Pick<S, K> | Partial<S> | null) | (Pick<S, K> | Partial<S> | null), callback?: () => void): void;
 
static contextType?: Context<any>;
static defaultProps?: any;
static displayName?: string;
 
static getDerivedStateFromError?(error: any): object | null;
static getDerivedStateFromProps?(props: Readonly<object>, state: Readonly<object>): object | null;
}

§Type Parameters

§
P = {}
[src]
§
S = {}
[src]

§Methods

§
componentDidCatch?(error: any, errorInfo: ErrorInfo): void
[src]
§
componentDidMount?(): void
[src]
§
componentDidUpdate?(
previousProps: Readonly<P>,
previousState: Readonly<S>,
snapshot: any,
): void
[src]
§
componentWillMount?(): void
[src]
§
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void
[src]
§
componentWillUnmount?(): void
[src]
§
componentWillUpdate?(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): void
[src]
§
getChildContext?(): object
[src]
§
getSnapshotBeforeUpdate?(oldProps: Readonly<P>, oldState: Readonly<S>): any
[src]
§
shouldComponentUpdate?(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): boolean
[src]

§Type Parameters

§Constructors

§
new Component(props?: P, context?: any)
[src]

§Properties

§
base: Element | Text
[src]
§
context: any
[src]
§
state: Readonly<S>
[src]

§Methods

§
forceUpdate(callback?: () => void): void
[src]
§
render(props?: RenderableProps<P>, state?: Readonly<S>, context?: any): ComponentChild abstract
[src]
§
setState<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => Pick<S, K> | Partial<S> | null) | (Pick<S, K> | Partial<S> | null), callback?: () => void): void
[src]

§Static Properties

§
contextType: Context<any>
[src]
§
defaultProps: any
[src]
§
displayName: string
[src]

§Static Methods

§
getDerivedStateFromError(error: any): object | null optional
[src]
§
getDerivedStateFromProps(props: Readonly<object>, state: Readonly<object>): object | null optional
[src]