File tree Expand file tree Collapse file tree 5 files changed +14
-14
lines changed
wrapServerComponentRenderer Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from 'react';
22import ReactOnRails from '../ReactOnRails.client.ts' ;
33import RSCRoute from '../RSCRoute.ts' ;
44import { ReactComponentOrRenderFunction } from '../types/index.ts' ;
5- import WrapServerComponentRenderer from '../wrapServerComponentRenderer/client.tsx' ;
5+ import wrapServerComponentRenderer from '../wrapServerComponentRenderer/client.tsx' ;
66
77/**
88 * Registers React Server Components (RSC) with React on Rails.
@@ -37,7 +37,7 @@ import WrapServerComponentRenderer from '../wrapServerComponentRenderer/client.t
3737const registerServerComponent = ( ...componentNames : string [ ] ) => {
3838 const componentsWrappedInRSCRoute : Record < string , ReactComponentOrRenderFunction > = { } ;
3939 for ( const name of componentNames ) {
40- componentsWrappedInRSCRoute [ name ] = WrapServerComponentRenderer ( ( props : unknown ) => (
40+ componentsWrappedInRSCRoute [ name ] = wrapServerComponentRenderer ( ( props : unknown ) => (
4141 < RSCRoute componentName = { name } componentProps = { props } />
4242 ) ) ;
4343 }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from 'react';
22import ReactOnRails from '../ReactOnRails.client.ts' ;
33import RSCRoute from '../RSCRoute.ts' ;
44import { ReactComponent , RenderFunction } from '../types/index.ts' ;
5- import WrapServerComponentRenderer from '../wrapServerComponentRenderer/server.tsx' ;
5+ import wrapServerComponentRenderer from '../wrapServerComponentRenderer/server.tsx' ;
66
77/**
88 * Registers React Server Components (RSC) with React on Rails for the server bundle.
@@ -28,7 +28,7 @@ import WrapServerComponentRenderer from '../wrapServerComponentRenderer/server.t
2828const registerServerComponent = ( components : Record < string , ReactComponent > ) => {
2929 const componentsWrappedInRSCRoute : Record < string , RenderFunction > = { } ;
3030 for ( const [ componentName ] of Object . entries ( components ) ) {
31- componentsWrappedInRSCRoute [ componentName ] = WrapServerComponentRenderer ( ( props : unknown ) => (
31+ componentsWrappedInRSCRoute [ componentName ] = wrapServerComponentRenderer ( ( props : unknown ) => (
3232 < RSCRoute componentName = { componentName } componentProps = { props } />
3333 ) ) ;
3434 }
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ import getReactServerComponent from '../getReactServerComponent.client.ts';
88
99ensureReactUseAvailable ( ) ;
1010
11- const WrapServerComponentRenderer = ( componentOrRenderFunction : ReactComponentOrRenderFunction ) => {
11+ const wrapServerComponentRenderer = ( componentOrRenderFunction : ReactComponentOrRenderFunction ) => {
1212 if ( typeof componentOrRenderFunction !== 'function' ) {
13- throw new Error ( 'WrapServerComponentRenderer : component is not a function' ) ;
13+ throw new Error ( 'wrapServerComponentRenderer : component is not a function' ) ;
1414 }
1515
1616 const wrapper : RenderFunction = async ( props , railsContext , domNodeId ) => {
@@ -19,7 +19,7 @@ const WrapServerComponentRenderer = (componentOrRenderFunction: ReactComponentOr
1919 : componentOrRenderFunction ;
2020
2121 if ( typeof Component !== 'function' ) {
22- throw new Error ( 'WrapServerComponentRenderer : component is not a function' ) ;
22+ throw new Error ( 'wrapServerComponentRenderer : component is not a function' ) ;
2323 }
2424
2525 if ( ! railsContext ) {
@@ -60,4 +60,4 @@ const WrapServerComponentRenderer = (componentOrRenderFunction: ReactComponentOr
6060 return wrapper ;
6161} ;
6262
63- export default WrapServerComponentRenderer ;
63+ export default wrapServerComponentRenderer ;
Original file line number Diff line number Diff line change 1- const WrapServerComponentRenderer = ( ) => {
1+ const wrapServerComponentRenderer = ( ) => {
22 // Do nothing
33 // Server component renderers are client components and not needed in the RSC bundle
44} ;
55
6- export default WrapServerComponentRenderer ;
6+ export default wrapServerComponentRenderer ;
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import getReactServerComponent from '../getReactServerComponent.server.ts';
44import { createRSCProvider } from '../RSCProvider.tsx' ;
55import isRenderFunction from '../isRenderFunction.ts' ;
66
7- const WrapServerComponentRenderer = ( componentOrRenderFunction : ReactComponentOrRenderFunction ) => {
7+ const wrapServerComponentRenderer = ( componentOrRenderFunction : ReactComponentOrRenderFunction ) => {
88 if ( typeof componentOrRenderFunction !== 'function' ) {
9- throw new Error ( 'WrapServerComponentRenderer : component is not a function' ) ;
9+ throw new Error ( 'wrapServerComponentRenderer : component is not a function' ) ;
1010 }
1111
1212 const wrapper : RenderFunction = async ( props , railsContext ) => {
@@ -19,7 +19,7 @@ const WrapServerComponentRenderer = (componentOrRenderFunction: ReactComponentOr
1919 : componentOrRenderFunction ;
2020
2121 if ( typeof Component !== 'function' ) {
22- throw new Error ( 'WrapServerComponentRenderer : component is not a function' ) ;
22+ throw new Error ( 'wrapServerComponentRenderer : component is not a function' ) ;
2323 }
2424
2525 const RSCProvider = createRSCProvider ( {
@@ -41,4 +41,4 @@ const WrapServerComponentRenderer = (componentOrRenderFunction: ReactComponentOr
4141 return wrapper ;
4242} ;
4343
44- export default WrapServerComponentRenderer ;
44+ export default wrapServerComponentRenderer ;
You can’t perform that action at this time.
0 commit comments