React Performance Issues And Solutions
blog.lusito.info·13h
🚀Performance
Preview
Report Post

While I do stand by my statement, that you should stop using React, I am aware, that you aren’t always able to just rewrite an existing project.

This article is here to help those unfortunate souls.

React Works Better With Stable References

React tries to avoid work when nothing changes. However, the test for change is usually a direct or shallow comparison.

So whenever you create a new instance of something that is used by React, it might cause React to do more work.

Not every new instance is easily spotted:

  • Using Array.filter/map are often overlooked.
  • Instances that are created outside of the component, for example in another function or custom hook are missed by both human reviewers and automatic…

Similar Posts

Loading similar posts...