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
181
181
}
182
182
183
183
const serverRenderReactComponent : typeof serverRenderReactComponentInternal = ( options ) => {
184
- let result : string | Promise < RenderResult > | null = null ;
185
184
try {
186
- result = serverRenderReactComponentInternal ( options ) ;
185
+ return serverRenderReactComponentInternal ( options ) ;
187
186
} finally {
188
187
// Reset console history after each render.
189
188
// 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 = [ ] ;
195
192
}
196
- return result ;
197
193
} ;
198
194
199
195
export default serverRenderReactComponent ;
You can’t perform that action at this time.
0 commit comments