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

> At worst it's unnecessary

Not really. The problem goes beyond re-rendering 15 times. For instance, how do you instrument usage? It can’t be simply debounced.

Similarly, you’ll be making unnecessary requests. e.g., we need to fetch X when this prop changes.

Or, we need to lazy load X once.

And back to re-rendering, there’s plenty of apps rendering @1FPS when dragging elements.



Thank you, that was the example I needed to hear to see why this could be an issue.

I will still say though, I have not actually had this happen to me yet with all the years of using hooks. Generally when I'm fetching when X prop changes, it's not in response to functions or objects, and I guess if it's ever happened it's been fixed and never broke or hasn't caused problems.

Not to say it isn't an issue - it is - but the number and degree of issues I saw with lifecycle functions was much worse. That was with a less experienced team, so it could just be bias.




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

Search: