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]:prop-types: handle component returning null #2696

Merged
merged 1 commit into from Jul 10, 2020

Conversation

hank121314
Copy link
Contributor

@hank121314 hank121314 commented Jul 6, 2020

This pr is related to #2654 (comment)
Previous isJSXFunctionComponent did not handle nullable component correctly.
So I replaced it with utils.isReturningJSXOrNull.
Sorry for the issue.

Fixes #2705.

tests/lib/rules/prop-types.js Outdated Show resolved Hide resolved
tests/lib/rules/no-unused-prop-types.js Outdated Show resolved Hide resolved
@hank121314 hank121314 changed the title [Fix]:prop-types: handle nullable component in propTypes [Fix]:prop-types: handle nullable component in propTypes and [Fix]:no-unused-prop-types: fix typo in testcase Jul 6, 2020
@ljharb ljharb changed the title [Fix]:prop-types: handle nullable component in propTypes and [Fix]:no-unused-prop-types: fix typo in testcase [Fix]:prop-types: handle nullable component in propTypes Jul 10, 2020
@ljharb ljharb changed the title [Fix]:prop-types: handle nullable component in propTypes [Fix]:prop-types: handle component returning null Jul 10, 2020
@ljharb

This comment has been minimized.

@hank121314

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

'missing in props validation' when returning with a ternary operator
2 participants