Hello,
We are implementing the dropdown from this example:https://www.telerik.com/kendo-react-ui/components/dropdowns/dropdownlist/
But setting the same array of fields with useState but we get the error "Typeerror: data.findindex is not a function" , the code is below, some get would be very appreciated.
useEffect(()=>{
fetchCompModelData()
}, [])
constfetchCompModelData = async () => {
try{
const uniqueItemsModel = uniqueElementModel(result.data);
setCompModelData(uniqueItemsModel);
debugger
}catch(err){
console.log("AXIOS ERROR", err.message);
}
}
const uniqueElementModel = async (arr) => {
const datatest = ["test",
"GA 315",
"V320TS",
"RS200n-W115",
"RS110IE-A110",
"RS110IE-A125"];
return datatest
}
const [compModelData, setCompModelData] = useState([])
return (
<div>
<div className="mb-3">
<label htmlFor="brand-name" className="text-info"> Model </label>
<DropDownList
data={compModelData}
/>
</div>
</div>
)
}