Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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;