useCookie typescript saying that Boolean should be a string, when it's a boolean
I have code that does:
Problem is,
isLoggedIn.value
actually returns a Boolean
, not a string like TypeScript thinks π So looks like something might be wrong with the docs for this π
How to fix it?
Literally this works:
But typescript says it's wrong.1 Reply
The return value of useCookie is typed as
string | undefined | null
by default. You can override that via its type argument