bereaksi menjalankan kode setelah set
const [foo, setFoo] = useState('bar')
useEffect(() => {
console.log('foo changed')
}, [foo])
florinrelea
const [foo, setFoo] = useState('bar')
useEffect(() => {
console.log('foo changed')
}, [foo])