Javascript – React Hooks: How do I run setState only after all necessary data is fetched from an API
I have an async method called getInitialData to fetch all necessary data from an API. Once the data is fetched, I am passing the data into a table. But by the time the data has been fetched, the data is…