Giter VIP home page Giter VIP logo

Comments (8)

Vandell63 avatar Vandell63 commented on May 14, 2024 3

Yes i see now sorry. You're right !. The error disappear only when you change the Max value. But when you change the min value only the isValid property trigger. But the error don't disappear.
So point 1 and 2 correct but not the third one. :/ . I continue to investigate

I'm pretty sure that it is linked with -> #28
Where the form is not sync with the schema after a first validation

from resolvers.

Mathius17 avatar Mathius17 commented on May 14, 2024 2

Thanks @bluebill1049! I'm closing the issue then.

from resolvers.

Vandell63 avatar Vandell63 commented on May 14, 2024 1

Hey @Mathius17 i have check your code and i found some issue and misunderstood of how yup work when you want to check two values.

  1. you should remove your schema from your component
  2. you should test your logic in the schema directly

I suggest you an alternative to your code here -> https://codesandbox.io/s/infallible-panini-uz2ri?file=/src/App.js
Hope your understand the difference and the yup logic behind.
There is no issue here in the react-hook-form But i found one with yup. i will open a new issue for this.

from resolvers.

Mathius17 avatar Mathius17 commented on May 14, 2024 1

@Vandell63 I just checked your alternative code again and repeating the "Steps to reproduce" in your example is giving me the same results unfortunately.

I can dig deeper and make a PR if necessary, but I'm trying to understand first where the error comes from.

from resolvers.

Mathius17 avatar Mathius17 commented on May 14, 2024

Thank you very much @Vandell63! I definitely like your approach way more and now I have a better understanding of how to check two fields dependent on each other in Yup.

One last question just to make sure we're on the same page. The issue still remains, right? Although is a problem with Yup itself.

from resolvers.

Vandell63 avatar Vandell63 commented on May 14, 2024

No sorry, your issue is fixed for me.
i just got another another issue with yup about context object inject into the form. Sorry it is independent from your case.
I think we have resolve it right ?

from resolvers.

bluebill1049 avatar bluebill1049 commented on May 14, 2024

Thanks, guys, will investigate the cause of the issue.

from resolvers.

bluebill1049 avatar bluebill1049 commented on May 14, 2024

react hook form validate a single field at a time (this allow us to optimize render), if you need to depend field to trigger validation, you can use trigger.

from resolvers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.