1👍
✅
useState return an array, not an object
From your code
const Charts = () => {
// const { setDailyData, dailyData } = useState([]);
const [dailyData, setDailyData] = useState([]) // <-- change to this
useEffect(() => {
const fetchAPI = async () => {
setDailyData(await fetchDailyData());
};
console.log(dailyData);
fetchAPI();
}, []);
Source:stackexchange.com