Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I despise the prevValues paradigm that crops up. Its even recommended in these docs, under "Adjusting some state when a prop changes"

Having to keep a second variable around for every prop you need to compare is just miserable to work with. useEffect is less efficient, but so much more obvious in a situation like this. "I want to do something when this value changes, and ONLY when this value changes" seems like something React should be able to handle elegantly. It happens literally all the time.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: