You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using @material-ui input with input adornments however works:
<FormControlvariant="outlined"className={classes.formControl}><InputLabelhtmlFor="amount">Amount</InputLabel><OutlinedInputinputRef={register({validate: (value)=>value&&typeofvalue==="number"&&value>0,})}name="amount"value={amount}onChange={(e)=>setAmount(e.target.value)}startAdornment={<InputAdornmentposition="start">$</InputAdornment>}labelWidth={60}/>{errors.amount&&(<FormHelperTexterrorvariant="outlined">
Please enter an amount
</FormHelperText>)}</FormControl>
The text was updated successfully, but these errors were encountered:
The error validations do not work very well with react-hook-form
On submit, the error is not displayed when validation fails
Relevant CodeSandbox
Using
@material-ui
input with input adornments however works:The text was updated successfully, but these errors were encountered: