use-ref-state
v0.0.3
Published
Combine useRef and useState hook
Downloads
26
Readme
use-ref-state
Copied from https://ryankubik.com/blog/use-ref-state/
Usage
const ComponentWithEvent = () => {
const [state, stateRef, setState] = useRefState(0);
useEffect(() => {
setTimeout(() => {
console.log(stateRef.current);
}, 100);
}, []);
setState(1);
};