/** * copy from https://github.com/react-component/util/blob/9d5cb8946da29e690bead78b2c251da6f7cbd0eb/src/hooks/useState.ts */ type Updater = T | ((prevValue: T) => T); export type SetState = (nextValue: Updater, /** * Will not update state when destroyed. * Developer should make sure this is safe to ignore. */ ignoreDestroy?: boolean) => void; /** * Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed. * We do not make this auto is to avoid real memory leak. * Developer should confirm it's safe to ignore themselves. */ export declare function useSafeState(defaultValue?: T | (() => T)): [T, SetState]; export {};