'How to optimise React Native App Performance in terms of preventing component re-rendering again and again
I would like to improve component performance but after analysis of many components I got to know there is a very huge amount of re-rendering is going on with each component, is there any way to reduce the re-rendering of components in React?
Solution 1:[1]
There are multiple ways to try to avoid re rendering the component .
- React.memo or React.PureComponent (Best way) find out more detail on https://dmitripavlutin.com/use-react-memo-wisely/
- Make sure property values don't change
- Passing objects as props
- Using keys to avoid re-renders
- Avoid changes in the DOM tree structure
you can find out more details on https://www.debugbear.com/blog/react-rerenders
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Amir Doreh |
