File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -181,19 +181,15 @@ function serverRenderReactComponentInternal(options: RenderParams): null | strin
181181}
182182
183183const serverRenderReactComponent : typeof serverRenderReactComponentInternal = ( options ) => {
184- let result : string | Promise < RenderResult > | null = null ;
185184 try {
186- result = serverRenderReactComponentInternal ( options ) ;
185+ return serverRenderReactComponentInternal ( options ) ;
187186 } finally {
188187 // Reset console history after each render.
189188 // See `RubyEmbeddedJavaScript.console_polyfill` for initialization.
190- // We don't need to clear the console history if the result is a promise
191- // Promises only supported in node renderer and node renderer takes care of cleanining console history
192- if ( typeof result === 'string' ) {
193- console . history = [ ] ;
194- }
189+ // This is necessary when ExecJS and old versions of node renderer are used.
190+ // New versions of node renderer reset the console history automatically.
191+ console . history = [ ] ;
195192 }
196- return result ;
197193} ;
198194
199195export default serverRenderReactComponent ;
You can’t perform that action at this time.
0 commit comments