im often forced to code react because everyone else uses it.
i've never seen anything as ridiculous as incrementing a value like its done in react:
const [inc, setInc] = useState(0);
useEffect(() => {
const ti = setInterval(() => {
setInc(prevState => prevState + 1);
}, 3000)
return () => {
clearInterval(ti);
}
}, []);
useEffect(() => {
console.log(inc);
}, [inc]);