I'm new to React and I would like to know how can I insert leading zeroes if the input number is less then 10. I mean, the defaultValue is 00 and, if I type 1, I want a zero to be automatically inserted in front of 1, having 01 in the input tag field. I'm using React Hook Form to manipulate the form.
<input
type="number"
name="Number"
defaultValue="00"
ref={register({ required: true })}
/>
Do you guys have any idea how to do this?
Thank you all!