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.
18 lines
583 B
18 lines
583 B
/**
|
|
* Returns a function that triggers a component update. the hook equivalent to
|
|
* `this.forceUpdate()` in a class component. In most cases using a state value directly
|
|
* is preferable but may be required in some advanced usages of refs for interop or
|
|
* when direct DOM manipulation is required.
|
|
*
|
|
* ```ts
|
|
* const forceUpdate = useForceUpdate();
|
|
*
|
|
* const updateOnClick = useCallback(() => {
|
|
* forceUpdate()
|
|
* }, [forceUpdate])
|
|
*
|
|
* return <button type="button" onClick={updateOnClick}>Hi there</button>
|
|
* ```
|
|
*/
|
|
export default function useForceUpdate(): () => void;
|