|
Download react-use/docs/useUpdate.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 335 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useUpdate.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/useUpdate.md
-
curl -L -o useUpdate.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useUpdate.md
335 Bytes
| # `useUpdate` | |
| React utility hook that returns a function that forces component | |
| to re-render when called. | |
| ## Usage | |
| ```jsx | |
| import {useUpdate} from 'react-use'; | |
| const Demo = () => { | |
| const update = useUpdate(); | |
| return ( | |
| <> | |
| <div>Time: {Date.now()}</div> | |
| <button onClick={update}>Update</button> | |
| </> | |
| ); | |
| }; | |
| ``` | |