Engineering note · React Js
Optimizing Performance with React.memo
Wrap components in React.memo to avoid unnecessary re-renders.
By Farah Jokhio Published
CODE SAMPLE
Code snippet
function MyComponent(props) {
// logic goes here
}
export default React.memo(MyComponent);
This will Prevent unnecessary re-renders using React.memo.
For More details check this blog.
More engineering notes
Simplify Context Usage with a Custom Hook
When using the Context API in multiple components, you can streamline access by creating a custom ho...
Custom Hook : Simplify Code with Reusable Logic
The custom hook in React allows to write data-fetching logic once and reuse it across multiple compo...