UNPKG

@openshift-console/dynamic-plugin-sdk

Version:

Provides core APIs, types and utilities used by dynamic plugins at runtime.

10 lines (9 loc) 523 B
import * as React from 'react'; /** * @deprecated - This hook is not related to console functionality. * Hook that ensures a safe asynchronnous setting of the React state in case a given component could be unmounted. * (https://github.com/facebook/react/issues/14113) * @param initialState initial state value * @returns An array with a pair of state value and its set function. */ export declare const useSafetyFirst: <S extends unknown>(initialState: S | (() => S)) => [S, React.Dispatch<React.SetStateAction<S>>];