Closed
Description
Problem
memo approach is enough understandable. However is not 100% elegant solution... Especially if you have more "wrappers" like connect, withRouter, or other HOC:
export default memo(
connect(mapStateToProps, mapDispatchToProps)(MyComponent),
)
Proposal
I will propose to do it following components configurations as displayName, propTypes, defaultProps...
MyComponent.displayName = 'NameOfMyComponent';
Something like:
export default function MyComponent() {
/* ... */
}
MyComponent.memo = true;
or
export default function MyComponent() {
/* ... */
}
MyComponent.memo = (nextProps, prevProps) => { /* ... */ };
Metadata
Metadata
Assignees
Labels
No labels