multiselect dropdown options display api from Db
onChange={this.submit} options={objectArray} displayValue="key" className="multi" selectedValues={selectedValues} />
multiselect dropdown options display api from Db
onChange={this.submit} options={objectArray} displayValue="key" className="multi" selectedValues={selectedValues} />
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vaibhav ChauhanRank #963 · 2.1K reputationPosted Jul 9, 2021, 3:53 AM EDT
selvi jpRank #4,123 · 364 reputationPosted Jul 9, 2021, 4:26 AM EDT
Vaibhav ChauhanRank #963 · 2.1K reputationPosted Jul 9, 2021, 4:47 AM EDT
In componentdidMount() function you can fetch data from API and set it in the state selectedValues
componentDidMount(){ fetch("api url here") .then(response=>{this.setState({selectValues:response})}); }some thing like this