-
Hi all, thanks again for all your help understanding Zustand. I have a dynamically built Zustand store, and I'm trying to update an attribute of each array from the response of an API call. The problem I am having is that Am I using useEffect wrong somehow? Do I need to use subscribe middleware? Or am I using Zustand wrong somehow? Item component:
List component:
Zustand Store:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
set((state) => ({
...state,
[_id] : {status: _value}
})), ☝️ that should be something like this 👇 ? set((state) => {
const services = [...state.services] // copy the array
services[_id] = {status: _value}
return { services }
}), |
Beta Was this translation helpful? Give feedback.
☝️ that should be something like this 👇 ?