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, propTypes: handle implicit children prop in react's generic types #3064

Merged
merged 1 commit into from Aug 30, 2021

Conversation

vedadeepta
Copy link
Contributor

@vedadeepta vedadeepta commented Aug 30, 2021

#3062

All react generic type extends from type PropsWithChildren<P> = P & { children?: ReactNode | undefined };. So whenever a generic type from React is used I've added an optional children prop to this.declaredPropTypes.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L824

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2021

Codecov Report

Merging #3064 (810806e) into master (cc95a82) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3064   +/-   ##
=======================================
  Coverage   97.42%   97.43%           
=======================================
  Files         111      111           
  Lines        7506     7522   +16     
  Branches     2758     2767    +9     
=======================================
+ Hits         7313     7329   +16     
  Misses        193      193           
Impacted Files Coverage Δ
lib/util/propTypes.js 97.30% <100.00%> (+0.07%) ⬆️

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 cc95a82...810806e. Read the comment docs.

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, seems good!

@Yohandah
Copy link

this PR introduced a regression : #3524

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.

None yet

4 participants