@@ -34,7 +34,7 @@ let shallowRender = (vnode, context) => renderToString(vnode, context, SHALLOW);
34
34
35
35
36
36
/** The default export is an alias of `render()`. */
37
- function renderToString ( vnode , context , opts , inner , isSvgMode ) {
37
+ function renderToString ( vnode , context , opts , inner , isSvgMode , selectValue ) {
38
38
if ( vnode == null || typeof vnode === 'boolean' ) {
39
39
return '' ;
40
40
}
@@ -152,11 +152,10 @@ function renderToString(vnode, context, opts, inner, isSvgMode) {
152
152
153
153
if ( name === 'value' ) {
154
154
if ( nodeName === 'select' ) {
155
- context = assign ( { } , context ) ;
156
- context . __preactSelect__ = v ;
155
+ selectValue = v ;
157
156
continue ;
158
157
}
159
- else if ( context . __preactSelect__ !== undefined && nodeName === 'option' && context . __preactSelect__ === v ) {
158
+ else if ( nodeName === 'option' && selectValue === v ) {
160
159
s += ` selected` ;
161
160
}
162
161
}
@@ -194,7 +193,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode) {
194
193
let child = children [ i ] ;
195
194
if ( child != null && child !== false ) {
196
195
let childSvgMode = nodeName === 'svg' ? true : nodeName === 'foreignObject' ? false : isSvgMode ,
197
- ret = renderToString ( child , context , opts , true , childSvgMode ) ;
196
+ ret = renderToString ( child , context , opts , true , childSvgMode , selectValue ) ;
198
197
if ( pretty && ! hasLarge && isLargeString ( ret ) ) hasLarge = true ;
199
198
if ( ret ) pieces . push ( ret ) ;
200
199
}
0 commit comments