Can't use setAtom normally #2992
-
Bug DescriptionHello and thank you for this amazing state management I've been using Jotai for almost 3 years now and now in a new project I am trying to use the useAtom with the normal value,setvalue but the setValue is throwing a type error 'use client'; import { AlertCircle } from 'lucide-react'; export function ErrorAlert() { useEffect(() => {
}, [error, setError]); return ( setError here is throwing Please help Reproduction Linkno link |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
And forgot to mention that the atom is being initialized like this export const errorAtom = atom<string | undefined>(undefined); |
Beta Was this translation helpful? Give feedback.
-
Even using const setError = useSetAtom(errorAtom); will throw this |
Beta Was this translation helpful? Give feedback.
-
Assuming it's a TypeScript error, I think you are not using |
Beta Was this translation helpful? Give feedback.
Assuming it's a TypeScript error, I think you are not using
"strict": true
in your tsconfig.json.