Hacker News new | ask | show | jobs
by hajile 2506 days ago
When discussing structural changes, it seems like lifting constant fragments a compile time wasn't discussed. There's a Babel React optimizer to do exactly this. Lift those to their own functions. Since those functions don't take any props or state, their values are cached almost indefinitely.
1 comments

A generalisation of that optimisation is discussed here: https://twitter.com/MateuszOkon/status/1159222281874366464