to validate an input filed in react-hook-form I am doing something like this
<input type="text" id="name" ref={register({ required: true, maxLength: 30 })} />
but thats at the submit time .. after I get response from the remote api endpoint I need to show some validation message .. in the same input field ...
You can use trigger function to trigger validation programmatically:
Documentation: https://react-hook-form.com/api/#trigger