qiniu / formstate-x

Manage state of form with ease.
https://qiniu.github.io/formstate-x
MIT License
33 stars 10 forks source link

First validate() call runs validator function twice #94

Closed mattleonowicz closed 6 months ago

mattleonowicz commented 8 months ago

I have noticed this bug, that first validate() call runs all the validator functions twice. Here is the simplest minimum reproducible example: https://codesandbox.io/p/sandbox/nice-fast-3vs9wy

I noticed because I started using async validators that call server and noticed double requests in the network. My use case is that sometimes I need to create a form with initial values and immediately validate it.

nighca commented 6 months ago

Nice catch!

nighca commented 6 months ago

Fixed in v3.1.2