codeman1o1
codeman1o1
NNuxt
Created by codeman1o1 on 3/22/2024 in #❓・help
State incorrectly typed as any
Hi! I'm pretty new to Nuxt modules, but I am making some progress. For my module I want to have a state which tracks the auth state. I wrote this in src/runtime/composables/states.ts:
import { useState } from "#imports"

export const useAuth = () => useState<boolean | null>("auth", () => null)
import { useState } from "#imports"

export const useAuth = () => useState<boolean | null>("auth", () => null)
The state works fine - as in the value is updated correctly - but it is typed as any instead of Ref<boolean | null>. How would I fix this?
9 replies