useUpdate.d.ts 319 B

12345678
  1. /**
  2. * Help to merge callback with `useLayoutEffect`.
  3. * One time will only trigger once.
  4. */
  5. export default function useUpdate(callback: VoidFunction): () => void;
  6. type Callback<T> = (ori: T) => T;
  7. export declare function useUpdateState<T>(defaultState: T | (() => T)): [T, (updater: Callback<T>) => void];
  8. export {};