inputRef={(ref: HTMLInputElement | null) => {
if (ref) {
register(ref, {
required: true,
pattern: /^[a-z'\-\s]+$/i
});
if (refInputName) refInputName.current = ref;
}
}}
How do I change this code, I'm new to the react-hook-form. Thanks