React.memo with class component code example
Example 1: import React, { memo } from 'react';
const MyComponent = React.memo(function MyComponent(props) {
/* only rerenders if props change */
});
Example 2: how to add react.memo in export list
export const MemoMainPostTopic = React.memo(MainPostTopic);
//or
const MainPostTopic = memo(() => {
...
})
export { MainPostTopic };