Make HomePage a server component and mount ActivityFeed via a client-only wrapper to avoid Suspense/dynamic boundary differences between SSR and hydration.
32 lines
739 B
TypeScript
32 lines
739 B
TypeScript
"use client";
|
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
type ActivityFeedComponent = React.ComponentType<Record<string, never>>;
|
|
|
|
export default function ActivityFeedClient() {
|
|
const [Comp, setComp] = useState<ActivityFeedComponent | null>(null);
|
|
|
|
useEffect(() => {
|
|
let cancelled = false;
|
|
(async () => {
|
|
try {
|
|
const mod = await import("../components/ActivityFeed");
|
|
const C = (mod as unknown as { default?: ActivityFeedComponent }).default;
|
|
if (!cancelled && typeof C === "function") {
|
|
setComp(() => C);
|
|
}
|
|
} catch {
|
|
// ignore
|
|
}
|
|
})();
|
|
return () => {
|
|
cancelled = true;
|
|
};
|
|
}, []);
|
|
|
|
if (!Comp) return null;
|
|
return <Comp />;
|
|
}
|
|
|