Skip to content

Add test for displayName on React.memo components#18925

Merged
bvaughn merged 2 commits into
react:masterfrom
eps1lon:test/memo-display-name
May 15, 2020
Merged

Add test for displayName on React.memo components#18925
bvaughn merged 2 commits into
react:masterfrom
eps1lon:test/memo-display-name

Conversation

@eps1lon

@eps1lon eps1lon commented May 14, 2020

Copy link
Copy Markdown
Collaborator

Summary

Adds a test for display name behavior of

const MemoComponent = React.memo(() => {});
MemoComponent.displayName = "SomeName";

The behavior was implemented in https://github.com/facebook/react/pull/18495/files#diff-ad60306adf3e53077dba1bbeabd57b19R30-R451 but untested. Commenting out the linked lines does not break any test on master.

1 Might need to scroll a bit when opening a link since the highlighted lines are collapsed initially.

Test Plan

n/a

@codesandbox-ci

codesandbox-ci Bot commented May 14, 2020

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7265700:

Sandbox Source
stupefied-thunder-j0myg Configuration

@sizebot

sizebot commented May 14, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 7265700

@sizebot

sizebot commented May 14, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 7265700

@bvaughn
bvaughn merged commit c390ab3 into react:master May 15, 2020
@eps1lon
eps1lon deleted the test/memo-display-name branch May 25, 2020 04:30
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* Add test for displayName on React.memo components

* Added extra memo displayName test

Co-authored-by: Brian Vaughn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants