class Inputfield extends Component {
render() {
return (
<>
<label className={classNames('textfield-outlined', this.props.className)}>
<input
name={this.props.name}
value={this.props.value}
type={this.props.type}
placeholder=" "
onChange={this.props.onChange}
autoComplete={ this.props.autoComplete ? "on" : "off"}
/>
<span>{this.props.label}</span>
</label>
</>
);
}
}
Inputfield.defaultProps={
type:"text",
label:"Enter the name of field",
autoComplete: true,
}
Inputfield.propTypes={
name: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
className: PropTypes.string,
onChange: PropTypes.func,
autoComplete: PropTypes.bool
}
это компонент ввода, как обрабатывать атрибут autoFocus в этом компоненте, который передается как реквизит? autoFocus = "on" или "of", autoFocus = "true" или "false" не работает ...!. tq заранее.