Юниверс DG SDK UI
v2.15.0

Интерфейс NewLifecycle<P, S, SS>

interface NewLifecycle<P, S, SS> {
    componentDidUpdate?(
        prevProps: Readonly<P>,
        prevState: Readonly<S>,
        snapshot?: SS,
    ): void;
    getSnapshotBeforeUpdate?(
        prevProps: Readonly<P>,
        prevState: Readonly<S>,
    ): SS | null;
}

Параметры типа

  • P
  • S
  • SS

Иерархия (Просмотр сводки)

Индекс

Методы

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Параметры

    • prevProps: Readonly<P>
    • prevState: Readonly<S>
    • Optionalsnapshot: SS

    Возвращает void

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Параметры

    • prevProps: Readonly<P>
    • prevState: Readonly<S>

    Возвращает SS | null