if (this.props.showFiltersHeader) {
const { tipoBusqueda } = this.props;
if (tipoBusqueda === '1')
this.setState({ filterFacturaNieType: 'N'});
else if (tipoBusqueda === '2')
this.setState({ filterFacturaNieType: 'F'});
return <div>
<div className="search-container">
<p>Buscar por NIE o Factura</p>
<div className="caja-select">
<select onChange={this.onChangeSelect} name="filterFacturaNieType" value={this.state.filterFacturaNieType}>
<option value='N'>NIE</option>
<option value='F'>Factura</option>
</select>
</div>
<span className="alert-span">{this.state.errors["filterFacturaNieType"]}</span>
</div>
....
}
你为什么不使用 setState ?,总是选择第一个选项
开心每一天1111
相关分类