skip to Main Content

React Native 'ERROR TypeError: Cannot convert undefined value to object'

I'm trying to retrieve data in this way: useEffect(() => { async function fetchData() { const response = await fetch('https://hasanadiguzel.com.tr/api/kurgetir'); const json = await response.json(); setData(json); } fetchData(); }, []); console.log(data.TCMB_AnlikKurBilgileri[0].Isim); When I run console.log(data.TCMB_AnlikKurBilgileri); upon opening the application, the…

VIEW QUESTION

React Native map "Undefined" is not a function

I'm trying to get data from API but. I'm getting this error Error Image. Here is my code. const [datas, setDatas] = useState(" "); const res = async () => { const response = await axios.get("http://hasanadiguzel.com.tr/api/kurgetir"); setDatas(response.data.TCMB_AnlikKurBilgileri); }; datas.map((item) =>…

VIEW QUESTION
Back To Top
Search