import React, { memo } from 'react';
function MyComponent(props) {
/* render using props */
}
function areEqual(prevProps, nextProps) {
/*
return true if passing nextProps to render would return
the same result as passing prevProps to render,
otherwise return false
*/
}
export default React.memo(MyComponent, areEqual);const MyComponent = React.memo(function MyComponent(props) {
/* only rerenders if props change */
});
Also in JavaScript:
- react error boundary
- how to print in js
- jquery find div with data attribute value
- adonisjs error: relation already exists
- js output html
- javascript get the last element of json
- gatsby-plugin-nprogress
- angular how to get previous state
- access selected option in jquery
- vuejs cdn
- javascript todataurl
- jspdf create table
- setting property to method in child class javascript
- kendo jquery listview
- set value of attribute using each and keyup jquery
- javascript open link in new tab
- import angular flex layout
- js extract all tags not have attr
- move file from one folder to another in aws s3 nodejs
- js static methods
- javascript resize image base64
- check when input number value goes up or down
- js generate random list of names with for loop
- how to get selected list item value in javascript