我有下面的梅组件,它呈现和输入装饰。这是示例。
<FormControl fullWidth sx={{ m: 1 }} variant="standard">
<InputLabel htmlFor="standard-adornment-amount">
Paid Fees
</InputLabel>
<Input
{...field}
name="paidFees"
id="standard-adornment-amount"
error={Boolean(errors["paidFees"])}
startAdornment={
<InputAdornment position="start">₹</InputAdornment>
}
/>
</FormControl>在输入API中,它接受error支持,但是没有传递helperText来显示错误消息的道具。
发布于 2022-04-25 03:50:46
也许您可以改为使用TextField而不是输入。下面是您可以尝试的TextField代码示例。
<TextField
error
id="outlined-error-helper-text"
label="Paid Fees"
helperText="Incorrect fees."
/>
https://stackoverflow.com/questions/71986842
复制相似问题