4 ms·
Re-rendering for state changes is a fairly easy thing to do, if you're willing to accept something like useState/setState. It can even be done application-side
by jeswin 6y ago
Re-rendering for state changes is a fairly easy thing to do, if you're willing to accept something like useState/setState. It can even be done application-side (without help from the lib). Basically, just wrap all state changes in setState and re-render everytime.
Now the optimization I haven't done is deciding whether a child needs to re-render when a parent re-renders. Comparing the props seems like a straightforward way to do this, so I'll probably spend some time over it today and implement it soon.
- ZephyrBlu 6y agoYep sorry, I misunderstood how your library works. I left another comment explaining what I misunderstood: https://news.ycombinator.com/item?id=25800961 https://news.ycombinator.com/item?id=25800961