Loading
Current section: Form Validation 5 exercises
Problem

Dynamic Error Validation with Hooks

Transcript

00:00 We've put together this error validation logic, but it actually isn't doing us any good because we have that no validate hook or attribute that we have to apply to our component to prevent the browser from doing its own validation. The problem with that is if the user submits

00:17 the form before our JavaScript has a chance to load, then they're going to be able to submit something incorrect. We don't want to put no validate on our form unless the JavaScript is ready to take over. We're going to dynamically add no validate

00:34 using a special hook called use hydrated, which I'm going to provide for you. You just need to grab that hook and then add that dynamic logic for a no validate attribute. Should be a pretty quick one. We'll see you when you're done.