Skip to content

Commit f694cb1

Browse files
committed
fix: No props in client components when { ssr: false } (#647)
When using `render(..., { ssr: false })`, we wrap client components in order for their initial render result on mount to be `null`, so that we can match the hydrated RSC payload. When doing this wrapping, we were not passing along the props passed to the wrapper. As a result, client components used in server components did not get the props passed to them from those server components. Fixes #583
1 parent 8e65f01 commit f694cb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/src/runtime/imports/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const clientWebpackRequire = memoize(async (id: string) => {
4242

4343
const Lazy = React.lazy(() => promisedDefault);
4444

45-
const Wrapped = () =>
46-
React.createElement(ClientOnly, null, React.createElement(Lazy));
45+
const Wrapped = (props: any) =>
46+
React.createElement(ClientOnly, null, React.createElement(Lazy, props));
4747

4848
return { [id]: Wrapped };
4949
});

0 commit comments

Comments
 (0)