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

[react] better types for React.Children, second generic parameter for ReactElement #32279

Merged

Conversation

ferdaber
Copy link
Contributor

Context

A lot of these changes are to help library authors better manipulate the ReactElement black box, and children in general.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:
If changing an existing definition:

  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback Author is Owner The author of this PR is a listed owner of the package. labels Jan 18, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 18, 2019

@ferdaber Thank you for submitting this PR!

🔔 @iocat @cprecioso @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Kovensky @pshrmn @Lavoaster - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 18, 2019

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 18, 2019

@ferdaber The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 19, 2019

@ferdaber The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Jan 25, 2019
@@ -2670,7 +2671,7 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
declare global {
namespace JSX {
// tslint:disable-next-line:no-empty-interface
interface Element extends React.ReactElement<any> { }
interface Element extends React.ReactElement<any, any> { }
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just let the second arg be default'd to the constraint, rather than any here.

@uniqueiniquity
Copy link
Contributor

@Jessidhia @johnnyreilly Can you review?

@johnnyreilly johnnyreilly merged commit afdf66d into DefinitelyTyped:master Jan 26, 2019
@johnnyreilly
Copy link
Member

Merged - thanks!

@yang
Copy link

yang commented Feb 24, 2019

Oops, disregard - I misread the inferred types.

zhzz added a commit to skbkontur/retail-ui that referenced this pull request Dec 19, 2019
@zhzz zhzz mentioned this pull request Dec 19, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Popular package This PR affects a popular package (as counted by NPM download counts). Unmerged The author did not merge the PR when it was ready.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants