Fluvials
#1016
Replies: 1 comment 3 replies
-
// component.tsx
import { someClientOnlyThing, someIsomorphicSafeThing } from "@external/src/module"
export function SafeComponent({ children }) {
return (
<>
<span>{someIsomorphicSafeThing.toString()}</span>
{children}
</>
);
}
export function ClientOnlyComponent() {
return (
<>
<button onClick={someClientOnlyThing}></button>
</>
);
} ---
import { SafeComponent, ClientOnlyComponent } from './component.tsx';
---
<SafeComponent client:load>
<ClientOnlyComponent client:only />
</SafeComponent> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Have non-SSR (
client:only
) components in SSR components (client:load
).Background & Motivation
Sometimes only a small portion of a client component depends on or requires client only functionality that can't be server rendered. Instead of authoring separate components files in such cases, it would be nice having a client directive for intracomponent partial hydration.
Example
Beta Was this translation helpful? Give feedback.
All reactions