I tried to make some test as React official documentation but can't see any loading state
my entire page is blocked for 10s
this my test/page.tsx
import { Suspense } from "react";
export default function Test() {
return (
<div>
<Suspense fallback={<p>loadding</p>}>
<Component></Component>
</Suspense>
</div>
);
}
function waitForSeconds(seconds: number) {
return new Promise((resolve) => {
setTimeout(resolve, seconds * 1000);
});
}
export async function Component() {
await waitForSeconds(10);
return <div className="h-10 w-10 bg-red-400"></div>;
}