Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] `displayName`: avoid a crash when using React.memo #2587

Merged
merged 1 commit into from Mar 7, 2020

Conversation

@golopot
Copy link
Contributor

golopot commented Mar 7, 2020

This pr adds a null check, to avoid a crash that happens when using React.memo plus a return statement without an argument. Like

import React from 'react';
const Hello = React.memo(function Hello() {
  return;
});
@ljharb
ljharb approved these changes Mar 7, 2020
@ljharb ljharb force-pushed the golopot:crash-with-memo branch from 376cb4e to 185d95c Mar 7, 2020
@ljharb ljharb merged commit 185d95c into yannickcr:master Mar 7, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 97.608%
Details
@golopot

This comment has been minimized.

Copy link
Contributor Author

golopot commented Mar 7, 2020

Thanks!

@golopot golopot deleted the golopot:crash-with-memo branch Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.