There are many ways to load data and most of these come down to personal preference. In web based applications I lean towards loading the whole page straight away and only showing a spinner or loading animation where I am fetching data. By taking this approach people don’t think the app is stuck as the whole page loaded.
For example if I have a table on page that fetches user data, I show an animation in the table saying data is loading.
A nice of fetching the data is building a custom hook that returns a loading state and the data.