Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuckerconnelly/use-ref-state
https://github.com/tuckerconnelly/use-ref-state
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tuckerconnelly/use-ref-state
- Owner: tuckerconnelly
- License: mit
- Created: 2020-01-10T18:36:26.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T04:59:12.000Z (almost 2 years ago)
- Last Synced: 2024-08-10T09:05:08.578Z (5 months ago)
- Language: JavaScript
- Size: 962 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# use-ref-state
Copied from https://ryankubik.com/blog/use-ref-state/
## Usage
```js
const ComponentWithEvent = () => {
const [state, stateRef, setState] = useRefState(0);useEffect(() => {
setTimeout(() => {
console.log(stateRef.current);
}, 100);
}, []);setState(1);
};
```