@tanstack/react-router-devtools 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-devtools",
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/",
@@ -35,7 +35,7 @@
35
35
  "src"
36
36
  ],
37
37
  "peerDependencies": {
38
- "@tanstack/react-router": "0.0.1-alpha.5",
38
+ "@tanstack/react-router": "0.0.1-alpha.6",
39
39
  "react": ">=16",
40
40
  "react-dom": ">=16"
41
41
  },
package/src/devtools.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Router, useRouter, last } from '@tanstack/react-router'
2
+ import { Router, last } from '@tanstack/react-router'
3
3
  import { formatDistanceStrict } from 'date-fns'
4
4
 
5
5
  import useLocalStorage from './useLocalStorage'
@@ -52,7 +52,7 @@ interface DevtoolsOptions {
52
52
  /**
53
53
  * A boolean variable indicating if the "lite" version of the library is being used
54
54
  */
55
- useRouter?: () => unknown
55
+ router: Router<any, any>
56
56
  }
57
57
 
58
58
  interface DevtoolsPanelOptions {
@@ -79,7 +79,7 @@ interface DevtoolsPanelOptions {
79
79
  /**
80
80
  * A boolean variable indicating if the "lite" version of the library is being used
81
81
  */
82
- useRouter: () => unknown
82
+ router: Router<any, any>
83
83
  }
84
84
 
85
85
  const isServer = typeof window === 'undefined'
@@ -91,7 +91,7 @@ export function TanStackRouterDevtools({
91
91
  toggleButtonProps = {},
92
92
  position = 'bottom-left',
93
93
  containerElement: Container = 'footer',
94
- useRouter: useRouterImpl = useRouter,
94
+ router,
95
95
  }: DevtoolsOptions): React.ReactElement | null {
96
96
  const rootRef = React.useRef<HTMLDivElement>(null)
97
97
  const panelRef = React.useRef<HTMLDivElement>(null)
@@ -230,7 +230,7 @@ export function TanStackRouterDevtools({
230
230
  <TanStackRouterDevtoolsPanel
231
231
  ref={panelRef as any}
232
232
  {...otherPanelProps}
233
- useRouter={useRouterImpl}
233
+ router={router}
234
234
  style={{
235
235
  position: 'fixed',
236
236
  bottom: '0',
@@ -360,11 +360,9 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
360
360
  isOpen = true,
361
361
  setIsOpen,
362
362
  handleDragStart,
363
- useRouter,
363
+ router,
364
364
  ...panelProps
365
365
  } = props
366
-
367
- const router = useRouter() as Router
368
366
  const routerExplorerValue = React.useMemo(() => {
369
367
  const {
370
368
  listeners,
@@ -848,7 +846,7 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
848
846
  <Button
849
847
  type="button"
850
848
  onClick={() => {
851
- router.invalidateRoute(activeMatch as any)
849
+ activeMatch.invalidate()
852
850
  router.notify()
853
851
  }}
854
852
  style={{
@@ -860,7 +858,7 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
860
858
  </Button>{' '}
861
859
  <Button
862
860
  type="button"
863
- onClick={() => router.reload()}
861
+ onClick={() => activeMatch.load()}
864
862
  style={{
865
863
  background: theme.gray,
866
864
  }}