我在 React 的 Material UI 中使用了可重用的 TextField,但我在使用条件时遇到了问题。InputLabelProps如果它没有传递给它,我就不需要使用。
请在下面检查我的可重用 TextField
<TextField
fullWidth
type={prop.type}
label={prop.label}
name={prop.name}
variant="outlined"
value={prop.value}
onChange={prop.handleChange}
onBlur={prop.onBlur}
helperText={prop.helperText}
error={prop.error}
{prop.InputLabelProps ? InputLabelProps={{
shrink: prop.InputLabelProps,
}} : ''}
/>