Skip to content

Commit

Permalink
fix: allow useMatch(rootRoute.id)
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Dec 8, 2022
1 parent 7669b9f commit bb3bae5
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/react-router/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,6 @@ export function createReactRouter<
useMatch: (routeId, opts) => {
useRouterSubscription(router)

invariant(
routeId !== rootRouteId,
`"${rootRouteId}" cannot be used with useMatch! Did you mean to useRoute("${rootRouteId}")?`,
)

const nearestMatch = useNearestMatch()
const match = router.state.currentMatches.find(
(d) => d.routeId === routeId,
Expand Down

0 comments on commit bb3bae5

Please sign in to comment.