Skip to content

Added support to React.memo

Compare
Choose a tag to compare
@vzaidman vzaidman released this 18 Mar 08:32
· 395 commits to master since this release

Make sure to add whyDidYouRender on the component after wrapping it with React.memo and not before.

const ReactMemoTestComponent = React.memo(() => (
  <div>hi!</div>
))
ReactMemoTestComponent.whyDidYouRender = true
ReactMemoTestComponent.dispalyName = 'ReactMemoTestComponent'