@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/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/link.cjs +4 -0
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/link.d.cts +2 -0
- package/dist/cjs/router.cjs +2 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/link.d.ts +2 -0
- package/dist/esm/link.js +4 -0
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/router.js +2 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +1 -1
- package/src/link.tsx +18 -0
- package/src/router.ts +1 -0
package/package.json
CHANGED
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
|
+
}
|