Open m4rvr opened 2 years ago
Are you setting the 'initialValues' option?
Without setting initialValues it might take an extra tick for Felte to set the stores.
Although I'd have expected that to already be available in onMount. I'll look into that.
Sorry, yes, I am setting the initialValues
. It's based on a value from a context.
Describe the bug
Hey! I have a form in a dynamic component which is shown and hidden based on the current view. When I change the view, the view with the form is unmounted and the existing errors disappear.
To solve this I want to re-validate the form in
onMount
so it shows the errors again when I switch to that view. But whenever I callvalidate
I get this error in the console: The error seems to be at thetouched.set
call?I also tried to reset the value and also set it as touched manually before but this doesn't work either.
The form only has one text input with a string value.
Let me know if you need a reproduction for it!
Which package/s are you using?
@felte/solid (SolidJS), @felte/reporter-solid, @felte/validator-zod
Environment
To reproduce
validate()
inside Solid'sonMount
Small reproduction example
No response
Screenshots
No response
Additional context
No response