@@ -10,7 +10,7 @@ declare global {
1010 function generateRSCPayload (
1111 componentName : string ,
1212 props : Record < string , unknown > ,
13- serverSideRSCPayloadParameters : unknown ,
13+ railsContext : RailsContext ,
1414 ) : Promise < NodeJS . ReadableStream > ;
1515}
1616
@@ -76,11 +76,10 @@ const RSCServerRoot: RenderFunction = async (
7676 ! railsContext ?. reactServerClientManifestFileName
7777 ) {
7878 throw new Error (
79- `${
80- 'serverClientManifestFileName and reactServerClientManifestFileName are required. ' +
79+ 'serverClientManifestFileName and reactServerClientManifestFileName are required. ' +
8180 'Please ensure that React Server Component webpack configurations are properly set ' +
82- 'as stated in the React Server Component tutorial. The received rails context is: '
83- } ${ JSON . stringify ( railsContext ) } ` ,
81+ 'as stated in the React Server Component tutorial. ' +
82+ 'Ensure to use "stream_react_component" instead of "react_component" to SSR a server component.' ,
8483 ) ;
8584 }
8685
@@ -96,11 +95,7 @@ const RSCServerRoot: RenderFunction = async (
9695 railsContext . reactServerClientManifestFileName ,
9796 railsContext . reactClientManifestFileName ,
9897 ) ;
99- const rscPayloadStream = await generateRSCPayload (
100- componentName ,
101- componentProps ,
102- railsContext . serverSideRSCPayloadParameters ,
103- ) ;
98+ const rscPayloadStream = await generateRSCPayload ( componentName , componentProps , railsContext ) ;
10499
105100 // Tee the stream to pass it to the server component and the payload container
106101 const rscPayloadStream1 = new PassThrough ( ) ;
0 commit comments