Replies: 2 comments
-
Hi
…On Thu, 24 Jul 2025, 8:31 pm bforl, ***@***.***> wrote:
I'm fairly new to React and Zustand (and JS in general)
Lets say I have a todo list where each todo item looks something like
{
name: ""todo Item 1",
time: "some time",
isValid: true,
validationMessage: "times collide!!"
}
what I want to do is each time a todo item is added, removed or edited in
the store, the entire array of items is validated and each todo item either
has isValid set to true or false and an appropriate validationMessage
set. The React component for each todo item would then re-render to show
whether it has a validation message or not.
How would I implement such an idea using Zustand?
—
Reply to this email directly, view it on GitHub
<#3190>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BUF75NXCZI7EDPPBMA5DLOT3KEJ77AVCNFSM6AAAAACCJPUEESVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZYGYZDSNJUGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I recently made a middleware for this called zustorm. It's for managing forms and validation with zustand. If you don't want to use that you can use other 3rd party libraries to calculate computed state. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm fairly new to React and Zustand (and JS in general)
Lets say I have a todo list where each todo item looks something like
what I want to do is each time a todo item is added, removed or edited in the store, the entire array of items is validated and each todo item either has
isValid
set to true or false and an appropriatevalidationMessage
set. The React component for each todo item would then re-render to show whether it has a validation message or not.How would I implement such an idea using Zustand?
Beta Was this translation helpful? Give feedback.
All reactions