Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

useForceUpdate.d.ts 583B

1234567891011121314151617
  1. /**
  2. * Returns a function that triggers a component update. the hook equivalent to
  3. * `this.forceUpdate()` in a class component. In most cases using a state value directly
  4. * is preferable but may be required in some advanced usages of refs for interop or
  5. * when direct DOM manipulation is required.
  6. *
  7. * ```ts
  8. * const forceUpdate = useForceUpdate();
  9. *
  10. * const updateOnClick = useCallback(() => {
  11. * forceUpdate()
  12. * }, [forceUpdate])
  13. *
  14. * return <button type="button" onClick={updateOnClick}>Hi there</button>
  15. * ```
  16. */
  17. export default function useForceUpdate(): () => void;