From the course: React: Advanced Code Challenges

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

How to maximize performance

How to maximize performance - React.js Tutorial

From the course: React: Advanced Code Challenges

How to maximize performance

- [Instructor] React is one of the most popular and developer-friendly libraries for building fast and interactive user interfaces. Thanks to its component-based architecture, the virtual DOM, and the hooks that makes it easy to build scalable applications quickly. But despite all this strength, using React doesn't guarantee optimal performance out of the box. And without careful coding, your app may run into unnecessary re-renders and also run unnecessary computations with expensive calculations. And may become slower as it grows because of complex logic. So, some of the solutions that we can use may involve optimizing rendering logic and minimize expensive operations. So, one first solution would be to minimize pure components by using React.memo that we use to prevent a component from re-rendering unless the props actually change. Another solution is with useMemo(), which is a hook that we use to cache the results from previous render. So, we don't need to recalculate the value if…

Contents