tfromme / continuum-loot

0 stars 1 forks source link

React Performance Optimizations #28

Closed tfromme closed 3 years ago

tfromme commented 3 years ago

Convert to Classes and implement shouldComponentUpdate on many components. See https://reactjs.org/docs/optimizing-performance.html The earlier this gets done, the easier it will be. This can also be done in many steps over time.

ahartzog commented 3 years ago

FYI @tfromme no need to convert to classes for this. Just export memo from react and wrap your export with it. This is the equivalent of declaring it as a pure component. It does the same shallow comparison of props to decide whether to re-render by default.

You can also provide a custom comparison function if you prefer.

image

tfromme commented 3 years ago

This could potentially be superseded by a refactor that includes less centralized data on the client side, doing more server side processing. TBD

tfromme commented 3 years ago

Migrating to ReactTable and memoizing all the data there is sufficient for this