Skip to content

Commit 0598e88

Browse files
committed
Use null when there are no errors
1 parent 8034c49 commit 0598e88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/router/src/RouterLink.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface UseLinkDevtoolsContext {
8484
route: RouteLocationNormalized & { href: string }
8585
isActive: boolean
8686
isExactActive: boolean
87-
error: string
87+
error: string | null
8888
}
8989

9090
export type UseLinkOptions = VueUseOptions<RouterLinkOptions>
@@ -192,7 +192,7 @@ export function useLink(props: UseLinkOptions) {
192192
route: route.value,
193193
isActive: isActive.value,
194194
isExactActive: isExactActive.value,
195-
error: '',
195+
error: null,
196196
}
197197

198198
// @ts-expect-error: this is internal
@@ -205,7 +205,7 @@ export function useLink(props: UseLinkOptions) {
205205
linkContextDevtools.isActive = isActive.value
206206
linkContextDevtools.isExactActive = isExactActive.value
207207
linkContextDevtools.error = isValidTo(unref(props.to))
208-
? ''
208+
? null
209209
: 'Invalid "to" value'
210210
},
211211
{ flush: 'post' }

0 commit comments

Comments
 (0)