Dashboard sipadu mbip
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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;