( options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>, )
| 34 | const timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>() |
| 35 | |
| 36 | export function useLinkProps< |
| 37 | TRouter extends AnyRouter = RegisteredRouter, |
| 38 | TFrom extends RoutePaths<TRouter['routeTree']> | string = string, |
| 39 | TTo extends string = '', |
| 40 | TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, |
| 41 | TMaskTo extends string = '', |
| 42 | >( |
| 43 | options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>, |
| 44 | ): Solid.ComponentProps<'a'> { |
| 45 | const router = useRouter() |
| 46 | const [isTransitioning, setIsTransitioning] = Solid.createSignal(false) |
| 47 | const shouldHydrateHash = !isServer && !!router.options.ssr |
| 48 | const hasHydrated = useHydrated() |
| 49 | |
| 50 | let hasRenderFetched = false |
| 51 | |
| 52 | const [local, rest] = Solid.splitProps( |
| 53 | Solid.mergeProps( |
| 54 | { |
| 55 | activeProps: () => ({ class: 'active' }), |
| 56 | inactiveProps: () => ({}), |
| 57 | }, |
| 58 | options, |
| 59 | ), |
| 60 | [ |
| 61 | 'activeProps', |
| 62 | 'inactiveProps', |
| 63 | 'activeOptions', |
| 64 | 'to', |
| 65 | 'preload', |
| 66 | 'preloadDelay', |
| 67 | 'hashScrollIntoView', |
| 68 | 'replace', |
| 69 | 'startTransition', |
| 70 | 'resetScroll', |
| 71 | 'viewTransition', |
| 72 | 'target', |
| 73 | 'disabled', |
| 74 | 'style', |
| 75 | 'class', |
| 76 | 'onClick', |
| 77 | 'onBlur', |
| 78 | 'onFocus', |
| 79 | 'onMouseEnter', |
| 80 | 'onMouseLeave', |
| 81 | 'onMouseOver', |
| 82 | 'onMouseOut', |
| 83 | 'onTouchStart', |
| 84 | 'ignoreBlocker', |
| 85 | ], |
| 86 | ) |
| 87 | |
| 88 | // const { |
| 89 | // // custom props |
| 90 | // activeProps = () => ({ class: 'active' }), |
| 91 | // inactiveProps = () => ({}), |
| 92 | // activeOptions, |
| 93 | // to, |
no test coverage detected