Skip to content

[react-router] Fix children render props test using match#58287

Merged
typescript-bot merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/react-router-match
Jan 25, 2022
Merged

[react-router] Fix children render props test using match#58287
typescript-bot merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/react-router-match

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

https://v5.reactrouter.com/web/api/match
https://v5.reactrouter.com/web/api/Route/children-func

}

const OldSchoolMenuLink: React.FC<OldSchoolMenuLinkProps> = ({ label, to, activeOnlyWhenExact }) => (
<Route path={to as string} exact={activeOnlyWhenExact} children={(params: { match: boolean }) => (
Copy link
Copy Markdown
Collaborator Author

@eps1lon eps1lon Jan 18, 2022

Choose a reason for hiding this comment

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

Was only passing because this function was assignable to {} but not the actual render-props: https://v5.reactrouter.com/web/api/Route/children-func.

@eps1lon eps1lon marked this pull request as ready for review January 18, 2022 19:33
@eps1lon eps1lon requested a review from johnnyreilly as a code owner January 18, 2022 19:33
@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

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

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

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 58287,
  "author": "eps1lon",
  "headCommitOid": "33befe7552537cc09fe06d2524da642d43cb5b00",
  "mergeBaseOid": "c609479376c92be2991c6d072a70201f7e225047",
  "lastPushDate": "2022-01-18T19:23:06.000Z",
  "lastActivityDate": "2022-01-25T09:03:00.000Z",
  "mergeOfferDate": "2022-01-25T00:33:49.000Z",
  "mergeRequestDate": "2022-01-25T09:03:00.000Z",
  "mergeRequestUser": "eps1lon",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "react-router",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-router/test/examples-from-react-router-website/CustomLink.tsx",
          "kind": "test"
        },
        {
          "path": "types/react-router/ts4.0/test/examples-from-react-router-website/CustomLink.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "sergey-buturlakin",
        "mrk21",
        "vasek17",
        "ngbrown",
        "awendland",
        "KostyaEsmukov",
        "johnnyreilly",
        "LKay",
        "DovydasNavickas",
        "huy-nguyen",
        "grmiade",
        "DaIgeb",
        "egorshulga",
        "rraina",
        "t49tran",
        "8enSmith",
        "wezleytsai",
        "eps1lon",
        "HipsterBrown",
        "pawfa"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "gabritto",
      "date": "2022-01-25T00:33:12.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 1015766922,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Author is Owner The author of this PR is a listed owner of the package. labels Jan 18, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @huy-nguyen @Grmiade @DaIgeb @egorshulga @rraina @t49tran @8enSmith @wezleytsai @HipsterBrown @pawfa — 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.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jan 25, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@eps1lon: Everything looks good here. I am ready to merge this PR (at 33befe7) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@sergey-buturlakin, @mrk21, @vasek17, @ngbrown, @awendland, @KostyaEsmukov, @johnnyreilly, @LKay, @DovydasNavickas, @huy-nguyen, @Grmiade, @DaIgeb, @egorshulga, @rraina, @t49tran, @8enSmith, @wezleytsai, @HipsterBrown, @pawfa: you can do this too.)

@eps1lon
Copy link
Copy Markdown
Collaborator Author

eps1lon commented Jan 25, 2022

Ready to merge

@typescript-bot typescript-bot merged commit 7163990 into DefinitelyTyped:master Jan 25, 2022
@eps1lon eps1lon deleted the fix/react-fragment/react-router-match branch January 25, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Critical package Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants