Dashboard sipadu mbip
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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;