@tanstack/react-router 0.0.1-alpha.5 → 0.0.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-alpha.5",
4
+ "version": "0.0.1-alpha.6",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://react-router.tanstack.com/",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@babel/runtime": "^7.16.7",
43
- "@tanstack/router-core": "0.0.1-alpha.5",
43
+ "@tanstack/router-core": "0.0.1-alpha.6",
44
44
  "use-sync-external-store": "^1.2.0"
45
45
  },
46
46
  "devDependencies": {
package/src/index.tsx CHANGED
@@ -415,7 +415,7 @@ export function RouterProvider<
415
415
  )
416
416
  }
417
417
 
418
- export function useRouter(): Router {
418
+ function useRouter(): Router {
419
419
  const value = React.useContext(routerContext)
420
420
  warning(!value, 'useRouter must be used inside a <Router> component!')
421
421
 
@@ -424,21 +424,21 @@ export function useRouter(): Router {
424
424
  return value.router as Router
425
425
  }
426
426
 
427
- export function useMatches(): RouteMatch[] {
427
+ function useMatches(): RouteMatch[] {
428
428
  return React.useContext(matchesContext)
429
429
  }
430
430
 
431
- export function useParentMatches(): RouteMatch[] {
432
- const router = useRouter()
433
- const match = useMatch()
434
- const matches = router.state.matches
435
- return matches.slice(
436
- 0,
437
- matches.findIndex((d) => d.matchId === match.matchId) - 1,
438
- )
439
- }
440
-
441
- export function useMatch<T>(): RouteMatch {
431
+ // function useParentMatches(): RouteMatch[] {
432
+ // const router = useRouter()
433
+ // const match = useMatch()
434
+ // const matches = router.state.matches
435
+ // return matches.slice(
436
+ // 0,
437
+ // matches.findIndex((d) => d.matchId === match.matchId) - 1,
438
+ // )
439
+ // }
440
+
441
+ function useMatch<T>(): RouteMatch {
442
442
  return useMatches()?.[0] as RouteMatch
443
443
  }
444
444