@tanstack/react-router 0.0.1-beta.30 → 0.0.1-beta.31

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-beta.30",
4
+ "version": "0.0.1-beta.31",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router/",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@babel/runtime": "^7.16.7",
44
- "@tanstack/router-core": "0.0.1-beta.30",
44
+ "@tanstack/router-core": "0.0.1-beta.31",
45
45
  "use-sync-external-store": "^1.2.0"
46
46
  },
47
47
  "devDependencies": {
package/src/index.tsx CHANGED
@@ -150,7 +150,6 @@ declare module '@tanstack/router-core' {
150
150
  useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(
151
151
  routeId: TId,
152
152
  ) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>
153
- useNearestMatch: () => RouteMatch<TAllRouteInfo, RouteInfo>
154
153
  useMatch: <
155
154
  TId extends keyof TAllRouteInfo['routeInfoById'],
156
155
  TStrict extends boolean = true,
@@ -328,8 +327,9 @@ export function createReactRouter<
328
327
  const composeHandlers =
329
328
  (handlers: (undefined | ((e: any) => void))[]) =>
330
329
  (e: React.SyntheticEvent) => {
331
- e.persist()
330
+ if (e.persist) e.persist()
332
331
  handlers.forEach((handler) => {
332
+ if (e.defaultPrevented) return
333
333
  if (handler) handler(e)
334
334
  })
335
335
  }
@@ -758,7 +758,7 @@ export function usePrompt(message: string, when: boolean | any): void {
758
758
  unblock()
759
759
  transition.retry()
760
760
  } else {
761
- router.location.pathname = window.location.pathname
761
+ router.state.location.pathname = window.location.pathname
762
762
  }
763
763
  })
764
764