react memo example
Example 1: react memo
function MyComponent(props) {
}
function areEqual(prevProps, nextProps) {
}
export default React.memo(MyComponent, areEqual);
Example 2: react memo
import React, { memo } from 'react'
const MyComponent = () => {
return <>something</>
}
export default memo(MyComponent)
Example 3: import React, { memo } from 'react';
const MyComponent = React.memo(function MyComponent(props) {
});
Example 4: how to add react.memo in export list
export const MemoMainPostTopic = React.memo(MainPostTopic);
const MainPostTopic = memo(() => {
...
})
export { MainPostTopic };