antd select Component option value is empty
Find the assignment option and print the original data
Reason: a piece of useless data is returned in the background. For this error, the returned data will be filtered directly in the background; In order to avoid the front-end error caused by such useless data; The front-end adds judgment and filters data;
let hospSelect = [] for (var i = 0; i < res.Hosp.length; i++) { if(res.Hosp[i].id&&res.Hosp[i].descripts) hospSelect.push({res.Hosp[i].descripts}) } this.setState({ hospSelect, })
Similar Posts:
- Using Vue + Axios: axios.post error: request failed with status code 400 is one of the solutions
- [Solved] npmError: EPERM: operation not permitted,…
- How to Solve antd Import error in Next.js
- Failed to resolve filter error [How to Solve]
- React uses antd to import error messages on demand
- Back end: 414 request URI too large solution
- Vue: How to use Vue-router in Axios
- The problem that the ipp.txt of OpenVPN is null and invalid
- How to Solve Mac Sed Error: command c expects followed by text