Replies: 4 comments 3 replies
-
Can you create a smallest possible reproduction with https://csb.jotai.org ? |
Beta Was this translation helpful? Give feedback.
-
I forgot to import the atom somewhere in the project. It's my mistake. Sorry! |
Beta Was this translation helpful? Give feedback.
-
In my situation, this error was caused by the name of my atom in my import { atom } from "jotai";
import { createRef } from "react";
// Jotai atoms
export const theCarouselAtom = atom({
// this won't work
// export const theYCarouselAtom = atom({
slideListRef: createRef<HTMLDivElement>(),
onNextClick: () => {},
onPrevClick: () => {},
nextDisabled: false,
prevDisabled: true,
activeSlide: 0,
}); |
Beta Was this translation helpful? Give feedback.
-
TypeError: Invalid value used as weak map key problem occurs If you have Dont use aggragated import { test1Atom, test2Atom } from "../../example/atoms" Use direct referance of atoms import { test1Atom, test2Atom } from "../../example/atoms/test.atoms" here the index.tsx file of atoms folder=>
If possible, avoid using index.tsx for aggregating and re-exporting atoms. Instead, import them directly from their respective files. This will ensure that each atom maintains its unique reference. |
Beta Was this translation helpful? Give feedback.
-
I got this issue when I defined atom in typescript outside the component
Beta Was this translation helpful? Give feedback.
All reactions