@@ -39,8 +39,17 @@ renderToString.render = renderToString;
39
39
*/
40
40
let shallowRender = ( vnode , context ) => renderToString ( vnode , context , SHALLOW ) ;
41
41
42
+ const EMPTY_ARR = [ ] ;
43
+ function renderToString ( vnode , context , opts ) {
44
+ const res = _renderToString ( vnode , context , opts ) ;
45
+ // options._commit, we don't schedule any effects in this library right now,
46
+ // so we can pass an empty queue to this hook.
47
+ if ( options . __c ) options . __c ( vnode , EMPTY_ARR ) ;
48
+ return res ;
49
+ }
50
+
42
51
/** The default export is an alias of `render()`. */
43
- function renderToString ( vnode , context , opts , inner , isSvgMode , selectValue ) {
52
+ function _renderToString ( vnode , context , opts , inner , isSvgMode , selectValue ) {
44
53
if ( vnode == null || typeof vnode === 'boolean' ) {
45
54
return '' ;
46
55
}
@@ -77,7 +86,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
77
86
for ( let i = 0 ; i < children . length ; i ++ ) {
78
87
rendered +=
79
88
( i > 0 && pretty ? '\n' : '' ) +
80
- renderToString (
89
+ _renderToString (
81
90
children [ i ] ,
82
91
context ,
83
92
opts ,
@@ -173,7 +182,8 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
173
182
context = assign ( assign ( { } , context ) , c . getChildContext ( ) ) ;
174
183
}
175
184
176
- return renderToString (
185
+ if ( options . diffed ) options . diffed ( vnode ) ;
186
+ return _renderToString (
177
187
rendered ,
178
188
context ,
179
189
opts ,
@@ -313,7 +323,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
313
323
: nodeName === 'foreignObject'
314
324
? false
315
325
: isSvgMode ,
316
- ret = renderToString (
326
+ ret = _renderToString (
317
327
child ,
318
328
context ,
319
329
opts ,
0 commit comments