Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Cómo configurar la tecla seleccionada en blanco cuando el menú desplegable de Office Fabric se restablece en React

Cómo obtener la propiedad estatal (ciudad seleccionada) en blanco en la función de representación cuando se restablece el menú desplegable. No me gusta escribir esto.setState({selectedCIty:"")}

 export default class ReactState extends React.Component< IReactStateProps, IReactStateState > { constructor(props) { super(props); this.state = { City: "", selectedCity: "", cityValues: [ { key: "Pune", text: "Pune", }, { key: "Kashmir", text: "Kashmir" }, { key: "London", text: "London" }, ], }; } public selectCity = (event: any, option?: any, index?: any) => { this.setState({ selectedCity: option.text }); }; public render(): React.ReactElement<IReactStateProps> { return ( <div className={styles.reactState}> <Dropdown options={this.state.cityValues} selectedKey={this.state.selectedCity} onChange={this.selectCity} ></Dropdown> <PrimaryButton text="Click Here" onClick={this.resetCityDD} ></PrimaryButton> {this.state.selectedCity}{" "} {/*How to set it to blank when dropdown get reset*/} </div> ); } public resetCityDD = () => { this.setState({ cityValues: [] }); }; }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!