Replies: 3 comments 5 replies
-
Hm - I just tested this myself without any issues. It's even more odd about the requirement for react. Only piece that requires react are the useSnapshot and useQuery hooks. I don't even think the need to require The Could you share some more details about how your build compilation / env is set up? |
Beta Was this translation helpful? Give feedback.
-
I only have I checked again. If I use
The usage is nothing special: import { proxy } from "valtio/vanilla";
import { proxyMap } from "valtio/vanilla/utils";
const state = proxy({
selection: proxyMap(),
flight: {},
airports: initialAirports(),
deletionState: {
isDeleted: false,
timestamp: null,
deletedBy: null,
},
});
[....]
import { snapshot, subscribe } from "valtio/vanilla";
const unsubscribe = subscribe(state.selection, () => {
if (state.selection.has(props.inputType)) {
const airport = snapshot(state.selection.get(props.inputType));
..... |
Beta Was this translation helpful? Give feedback.
-
Looking forward to better understand the real issue with your comment in the doc. Thks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Just sharing things about
Valtio/vanilla
.I had a hard time with a compilation error saying that I had to import
React
.👎 I imported
proxyMap
from "valtio/utils"Do: ✌️
Beta Was this translation helpful? Give feedback.
All reactions