The cause of slow rendering in React is mostly because of the number of re-render operations, which are sometimes unnecessary. There are two main tools provided by it to help users here:
memo(): This is used to prevent all of the unnecessary re-rendering carried out by the function components.
PureComponent: This is used to ensure that the unnecessary re-rendering of class components is avoided.