React JS - How do I bind json data to a dropdown list

后端 未结 4 1220
星月不相逢
星月不相逢 2021-02-10 08:39

I have a react JS file and I\'m attempting to bind data to a dropdown list. The data is stored in the following testing API/json file: https://api.myjson.com/bins/okuxu ...I wan

4条回答
  •  有刺的猬
    2021-02-10 09:09

    In this.state define the json -

    CityNames : {
                    CityName : 
                        [
                            {CityKey : 1,CityDescription: 'abc'},
                            {CityKey : 2,CityDescription: 'xyz'}
                        ]
    
            }
    

    Here is the code for Drop Down List

    
    

提交回复
热议问题