Hello!
I'm sorry for asking this because I'm sure this is stupid. But here I go:
I'm fetching kind of heavy data from my own API and using useRouteData() in my component, and would like to display it in a table with actions, like delete, update some values, etc.
So far so good, I'm getting the data, but it takes a few seconds, and my createStore call isn't waiting for the data to be available :
const routeData = useRouteData();
const [seriesRows, setSeriesRows] = createStore(routeData()?.map((data: Series) => ({
...data,
deleteSeries,
someMoreStuff
})) as SeriesRow[]);
What is the best, cleanest way to wait for routeData and then create the store?
Thank you for your time!
Wishing you a nice day.