Skip to content

[react-simple-maps] Stricter type for children renderProps#58288

Merged
gabritto merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/react-simple-maps
Jan 25, 2022
Merged

[react-simple-maps] Stricter type for children renderProps#58288
gabritto merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/react-simple-maps

Conversation

@eps1lon
Copy link
Copy Markdown
Collaborator

@eps1lon eps1lon commented Jan 18, 2022

We plan to remove {} from ReactFragment since it's not actually an allowed type for children of host components (e.g. <div>{{}}</div> would throw at runtime) (see #56026 for previous attempts).

This change is required to pass #56210

@DangerBotOSS
Copy link
Copy Markdown

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

react-simple-maps (unpkg)

was missing the following properties:

  1. useGeographies
  2. useZoomPan

Generated by 🚫 dangerJS against 3932958

}

export interface GeographiesProps extends React.SVGAttributes<SVGGElement> {
export interface GeographiesProps extends Omit<React.SVGAttributes<SVGGElement>, 'children'> {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously we would intersect the renderprops with ReactNode. But there isn't actually a valid intersection unless ReactNode includes {}. Docs only mention renderprops as well:

children | Function

-- https://www.react-simple-maps.io/docs/geographies/

@eps1lon eps1lon marked this pull request as ready for review January 18, 2022 19:37
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jan 18, 2022

@eps1lon Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

This PR can be merged once it's reviewed by a DT maintainer.

You can test the changes of this PR in the Playground.

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": 58288,
  "author": "eps1lon",
  "headCommitOid": "3932958116dce33cfbab86462d955f2ef2e3e43f",
  "mergeBaseOid": "c609479376c92be2991c6d072a70201f7e225047",
  "lastPushDate": "2022-01-18T19:23:55.000Z",
  "lastActivityDate": "2022-01-18T19:37:49.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "react-simple-maps",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-simple-maps/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "thepocp",
        "pronebird",
        "komenank"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1015770403,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added the Untested Change This PR does not touch tests label Jan 18, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @thepocp @pronebird @komenank — 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.

@gabritto gabritto merged commit 1504e09 into DefinitelyTyped:master Jan 25, 2022
@eps1lon eps1lon deleted the fix/react-fragment/react-simple-maps branch January 25, 2022 21:55
martin-badin pushed a commit to martin-badin/DefinitelyTyped that referenced this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Untested Change This PR does not touch tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants