Hacker News new | past | comments | ask | show | jobs | submit login

Unfortunately the "update on every render" is deeply anchored into devs minds, although in most cases play a minor role. It comes back from a time where browser JS engines where really slow to create lambdas - which is not the case anymore. Additionally, react doesn't really update the DOM on "render" (the internal react render cycle) - due to DOM diffing.

My best advice is (also apart from React): Do not spend time on imagined/anticipated performance bottlenecks; only ever spend time on performance tuning if there are real (perceived, not measurable!) performance issues (there has to be a profiling report in your hand).




Yeah I only started caring about this when tracking down lag in my app. Though it's fun to think about :)

I believe this causes a real Dom update because it can't know the onclick function hasn't materially changed. It's just diffing function references.




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

Search: