import { Greeting } from "@/components/greeting";
import { ErrorBoundary } from "next/dist/client/components/error-boundary";
import { ErrorFallback } from "@/components/error-fallback";
import { Suspense } from "react";
// Note: Prefetching the data (e.g., using prefetch(trpc.greeting.hello.queryOptions()))
// prevents the error, but this approach is not acceptable as per current requirements.
export default function Home() {
return (
<div className="flex items-center justify-center min-h-screen">
<ErrorBoundary errorComponent={ErrorFallback}>
<Suspense fallback={<div>Loading...</div>}>
<Greeting />
</Suspense>
</ErrorBoundary>
</div>
);
}
import { Greeting } from "@/components/greeting";
import { ErrorBoundary } from "next/dist/client/components/error-boundary";
import { ErrorFallback } from "@/components/error-fallback";
import { Suspense } from "react";
// Note: Prefetching the data (e.g., using prefetch(trpc.greeting.hello.queryOptions()))
// prevents the error, but this approach is not acceptable as per current requirements.
export default function Home() {
return (
<div className="flex items-center justify-center min-h-screen">
<ErrorBoundary errorComponent={ErrorFallback}>
<Suspense fallback={<div>Loading...</div>}>
<Greeting />
</Suspense>
</ErrorBoundary>
</div>
);
}