What are Pure Components?
- Components that implement shouldComponentUpdate
- Components that only have a render method
- Components that use the React.Pure API
- Components that use the useMemo hook
Pure components in React are components that implement the shouldComponentUpdate lifecycle method to improve performance. This method compares the current props and state to the next props and state, and determines whether the component needs to be re-rendered. If the props and state have not changed, the component can skip the rendering process.
Loading...