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

feat(remix-react): make RouteMatch a generic type #7333

Closed

Conversation

lpsinger
Copy link
Contributor

@lpsinger lpsinger commented Sep 4, 2023

Now the RouteMatch type is a generic type that supports type inference. So just as you can do useLoaderData<typeof loader>(), now you can also do RouteMatch<typeof loader>.

  • Docs
  • Tests

Testing Strategy:

Now the `RouteMatch` type is a generic type that supports type
inference. So just as you can do `useLoaderData<typeof loader>()`,
now you can also do `RouteMatch<typeof loader>`.
@lpsinger lpsinger changed the base branch from main to dev September 4, 2023 19:31
@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2023

🦋 Changeset detected

Latest commit: 7d07b8f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lpsinger lpsinger changed the title Route match data generic type feat(remix-react): make RouteMatch a generic type Sep 4, 2023
@brophdawg11
Copy link
Contributor

Thanks for the PR! This was actually also done as part of the larger type alignment with RR in #7319. RouteMatch was also renamed to UIMatch to more clearly differentiate it from the other *RouteMatch types we use as return values from matchRoutes in React Router.

Feel free to give it a shot and see if it works for you! npx upgrade-remix pre

@brophdawg11 brophdawg11 closed this Sep 8, 2023
@lpsinger lpsinger deleted the route-match-data-generic-type branch September 8, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants