@tanstack/react-router 1.62.0 → 1.63.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.62.0",
3
+ "version": "1.63.0",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/index.tsx CHANGED
@@ -42,7 +42,7 @@ export * from './history'
42
42
 
43
43
  export { lazyRouteComponent } from './lazyRouteComponent'
44
44
 
45
- export { useLinkProps, createLink, Link } from './link'
45
+ export { useLinkProps, createLink, Link, linkOptions } from './link'
46
46
  export type {
47
47
  CleanPath,
48
48
  Split,
package/src/link.tsx CHANGED
@@ -994,3 +994,21 @@ export const Link: LinkComponent<'a'> = React.forwardRef<Element, any>(
994
994
  function isCtrlEvent(e: MouseEvent) {
995
995
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
996
996
  }
997
+
998
+ export type LinkOptionsFn<TComp> = <
999
+ const TProps,
1000
+ TRouter extends AnyRouter = RegisteredRouter,
1001
+ TFrom extends string = string,
1002
+ TTo extends string | undefined = undefined,
1003
+ TMaskFrom extends string = TFrom,
1004
+ TMaskTo extends string = '',
1005
+ >(
1006
+ options: Constrain<
1007
+ TProps,
1008
+ LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>
1009
+ >,
1010
+ ) => TProps
1011
+
1012
+ export const linkOptions: LinkOptionsFn<'a'> = (options) => {
1013
+ return options as any
1014
+ }
package/src/router.ts CHANGED
@@ -2394,6 +2394,7 @@ export class Router<
2394
2394
  ...prev,
2395
2395
  isFetching: loaderRunningAsync ? prev.isFetching : false,
2396
2396
  loaderPromise: undefined,
2397
+ invalid: false,
2397
2398
  }))
2398
2399
  })(),
2399
2400
  )