@@ -145,7 +145,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
145145 }
146146
147147 // render JSX to HTML
148- let s = '' , html ;
148+ let s = '' , propChildren , html ;
149149
150150 if ( props ) {
151151 let attrs = Object . keys ( props ) ;
@@ -156,7 +156,10 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
156156 for ( let i = 0 ; i < attrs . length ; i ++ ) {
157157 let name = attrs [ i ] ,
158158 v = props [ name ] ;
159- if ( name === 'children' ) continue ;
159+ if ( name === 'children' ) {
160+ propChildren = v ;
161+ continue ;
162+ }
160163
161164 if ( name . match ( / [ \s \n \\ / = ' " \0 < > ] / ) ) continue ;
162165
@@ -194,6 +197,10 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
194197 if ( name === 'dangerouslySetInnerHTML' ) {
195198 html = v && v . __html ;
196199 }
200+ else if ( nodeName === 'textarea' && name === 'value' ) {
201+ // <textarea value="a&b"> --> <textarea>a&b</textarea>
202+ propChildren = v ;
203+ }
197204 else if ( ( v || v === 0 || v === '' ) && typeof v !== 'function' ) {
198205 if ( v === true || v === '' ) {
199206 v = name ;
@@ -241,7 +248,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
241248 }
242249 s += html ;
243250 }
244- else if ( props && getChildren ( children = [ ] , props . children ) . length ) {
251+ else if ( propChildren != null && getChildren ( children = [ ] , propChildren ) . length ) {
245252 let hasLarge = pretty && ~ s . indexOf ( '\n' ) ;
246253 let lastWasText = false ;
247254
0 commit comments