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] propType: ignore imported types/interface in forwardRef generic #3280

Merged

Conversation

vedadeepta
Copy link
Contributor

@vedadeepta vedadeepta commented Apr 30, 2022

Fixes: #3140

Fix is to ignore when type declarations are not present in the same file.

Turns out imported external interfaces & types were already handled by the searchDeclaration function, the error was happening because i mistakenly hardcoded ignorePropsValidation: false when handling the forwardRef<element, props> case 💀

@vedadeepta vedadeepta changed the title [Fix] propType: handle imported types/interface in forwardRef generic [Fix] propType: ignore imported types/interface in forwardRef generic Apr 30, 2022
@codecov
Copy link

codecov bot commented Apr 30, 2022

Codecov Report

Merging #3280 (8bfeadd) into master (b7a9c2a) will not change coverage.
The diff coverage is n/a.

❗ Current head 8bfeadd differs from pull request most recent head 6c88912. Consider uploading reports for the commit 6c88912 to get more accurate results

@@           Coverage Diff           @@
##           master    #3280   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files         123      123           
  Lines        8745     8745           
  Branches     3170     3170           
=======================================
  Hits         8546     8546           
  Misses        199      199           
Impacted Files Coverage Δ
lib/util/propTypes.js 97.43% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7a9c2a...6c88912. Read the comment docs.

@ljharb ljharb force-pushed the 3140-forwardRef-ignore-propTypes branch from 8bfeadd to 6c88912 Compare April 30, 2022 21:46
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

False positives of react/prop-types in forwardRefs with 7.27.0
2 participants