i think this is the quick approach you can take and show Loading... text of the basis of api response there are multiple way to handle this case its up to you
{user ? (
<h2 className="mb-4">Hi, {user.firstName}!</h2>
) : (
<h2 className="mb-4">Loading...</h2>
)}