objects received with fetch on a click event.
Since fetch is async, it'll return a promise. So if I want to sort it on click, I'll need to use the .then and use .sort inside it.
But if I want to .filter() on another button click then does that mean I'll have to fetch it again and do the filter()?
is there no way to extract the data from the Promise that async function return?
You’ll need to store that data after fetching it
So just by using fetch and basic js, it's not possible to extract?
It is, you can put your data in useState
Обсуждают сегодня