Skip to content

Conversation

@AlexUzan
Copy link

@AlexUzan AlexUzan commented Jan 6, 2021

Please fill in this template.

If changing an existing definition:

  • In forwardRef type definition, PropsWithChildren is used to wrap the Props in the argument but not in the return value, which causes Property 'children' does not exist on type ... when trying to pass children to a component created using forwardRef

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 6, 2021

@AlexUzan Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ❌ Only a DT maintainer can approve changes without tests

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 50436,
  "author": "AlexUzan",
  "headCommitOid": "51cff9182b2cebfe9e1a1236b3876dd3039cc2bb",
  "lastPushDate": "2021-01-06T15:48:18.000Z",
  "lastActivityDate": "2021-01-07T09:03:47.000Z",
  "maintainerBlessed": false,
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "react",
      "kind": "edit",
      "files": [
        {
          "path": "types/react/v16/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "johnnyreilly",
        "bbenezech",
        "pzavolinsky",
        "digiguru",
        "ericanderson",
        "DovydasNavickas",
        "theruther4d",
        "guilhermehubner",
        "ferdaber",
        "jrakotoharisoa",
        "pascaloliv",
        "hotell",
        "franklixuefei",
        "Jessidhia",
        "saranshkataria",
        "lukyth",
        "eps1lon",
        "zieka",
        "dancerphil",
        "dimitropoulos",
        "disjukr",
        "vhfmag",
        "hellatan"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "eps1lon",
      "date": "2021-01-06T19:32:47.000Z"
    }
  ],
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #50436 diff
Batch compilation
Memory usage (MiB) 127.3 125.8 -1.2%
Type count 34890 34890 0%
Assignability cache size 10207 10207 0%
Language service
Samples taken 2359 2359 0%
Identifiers in tests 2941 2941 0%
getCompletionsAtPosition
    Mean duration (ms) 333.6 335.9 +0.7%
    Mean CV 8.3% 8.0%
    Worst duration (ms) 1326.6 1490.2 +12.3%
    Worst identifier props x
getQuickInfoAtPosition
    Mean duration (ms) 335.0 337.5 +0.7%
    Mean CV 8.6% 8.6%
    Worst duration (ms) 1035.7 1154.9 +11.5%
    Worst identifier ref ref

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jan 6, 2021
@dimitropoulos
Copy link
Contributor

@AlexUzan: selfishly, may I ask your opinion on which of the following PropsWithChildren means to you?

  • Option A: "has children and also has other props"

  • Option B: "has children and may or may not have other props"

  • Option C: "has children and no other props"

Copy link
Collaborator

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Duplicate of #48420:

We plan to remove implicit children in a future major React release since they are problematic: #33006

-- #48420 (review)

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Jan 6, 2021
@typescript-bot
Copy link
Contributor

@AlexUzan One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@AlexUzan
Copy link
Author

AlexUzan commented Jan 7, 2021

@dimitropoulos I think it would be option B for me depending on what P is in PropsWithChildren<P>

@eps1lon Sorry I didn't know there was already a PR for that, you can close it if it is not needed then

@eps1lon
Copy link
Collaborator

eps1lon commented Jan 7, 2021

@eps1lon Sorry I didn't know there was already a PR for that, you can close it if it is not needed then

I can't do that. It'll stay open until the bot closes it due to staleness. You could close it though if you agree.

@AlexUzan AlexUzan closed this Jan 7, 2021
@dimitropoulos
Copy link
Contributor

thanks @AlexUzan :)

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

Labels

Critical package Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Revision needed This PR needs code changes before it can be merged. Untested Change This PR does not touch tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants