my-swiss-knife: - v1.9.9
    Preparing search index...

    Interface ComponentLifecycle<P, S, SS>

    interface ComponentLifecycle<P, S, SS = any> {
        componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
        componentDidMount?(): void;
        componentDidUpdate?(
            prevProps: Readonly<P>,
            prevState: Readonly<S>,
            snapshot?: SS,
        ): void;
        componentWillMount?(): void;
        componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
        componentWillUnmount?(): void;
        componentWillUpdate?(
            nextProps: Readonly<P>,
            nextState: Readonly<S>,
            nextContext: any,
        ): void;
        getSnapshotBeforeUpdate?(
            prevProps: Readonly<P>,
            prevState: Readonly<S>,
        ): SS | null;
        shouldComponentUpdate?(
            nextProps: Readonly<P>,
            nextState: Readonly<S>,
            nextContext: any,
        ): boolean;
        UNSAFE_componentWillMount?(): void;
        UNSAFE_componentWillReceiveProps?(
            nextProps: Readonly<P>,
            nextContext: any,
        ): void;
        UNSAFE_componentWillUpdate?(
            nextProps: Readonly<P>,
            nextState: Readonly<S>,
            nextContext: any,
        ): void;
    }

    Type Parameters

    • P
    • S
    • SS = any

    Hierarchy

    Index

    Methods

    • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

      Parameters

      Returns void

    • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

      Returns void

    • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

      Returns void

    • Called to determine whether the change in props and state should trigger a re-render.

      Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

      If false is returned, Component.render, componentWillUpdate and componentDidUpdate will not be called.

      Parameters

      Returns boolean