react wait for useeffect to finish then render the page fetch code example
Example: suspense react
import React, {Suspense} from 'react;
const ProfilePage = React.lazy(() => import('./ProfilePage')); // Lazy-loaded
// Show a spinner while the profile [data fetching] is loading
<Suspense fallback={<Spinner />}>
<ProfilePage />
</Suspense>