shouldComponentUpdateliknande
shouldComponentUpdate is a lifecycle method in React that allows developers to control when a component should re-render. This method is called before any updates occur and receives two parameters: nextProps and nextState. By default, React compares the entire props and state objects to determine if an update is necessary, which can be inefficient for large components.
The primary use case for shouldComponentUpdate is performance optimization. When a component receives new props or
Implementing shouldComponentUpdate typically involves shallow comparison of the new props and state with the current ones.
While shouldComponentUpdate provides fine-grained control over rendering, modern React patterns like React.memo and the useMemo hook