Files
test-rsc-2/src/pages/a/ClientApp.tsx
2026-04-14 13:16:16 +08:00

28 lines
740 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import List from './List.tsx';
// Client Component - 用于 hydration结构需要和 ServerApp 一致
declare global {
interface Window {
__SERVER_DATA__?: { version: string };
}
}
export default function ClientApp() {
const version = typeof window !== 'undefined' && window.__SERVER_DATA__?.version
? window.__SERVER_DATA__.version
: 'loading';
return <List version={version} />;
}
// 'use client';
// // import List from './List.tsx';
// export default function ClientApp() {
// const inner = typeof window !== 'undefined' && window.__SERVER_DATA__?.innerHtml
// const cm = inner ? <div dangerouslySetInnerHTML={{ __html: inner }}></div> : null;
// return <div>
// {cm}
// </div>
// }