Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Add support for React.memo #1204

Closed
wants to merge 1 commit into from
Closed

Add support for React.memo #1204

wants to merge 1 commit into from

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Oct 29, 2018

Remove React.pure (since it was never released in a stable) and add support for React.memo. Preserve previous custom displayName semantics.

Resolves #1193

Code

function CounterFunction({count}) {
  return <small>{count}</small>;
}
const A = React.memo(({count}) => <small>{count}</small>);
const B = React.memo(CounterFunction);
const C = React.memo(CounterFunction);
C.displayName = 'MemoCounterFunction';

DevTools

screen shot 2018-10-29 at 11 16 27 am

@bvaughn
Copy link
Contributor Author

bvaughn commented Oct 31, 2018

I'm just going to close this and roll everything into #1207 for simplicity.

@bvaughn bvaughn closed this Oct 31, 2018
@bvaughn bvaughn deleted the memo branch October 31, 2018 17:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants