node_modules/preact/compat/src/render.js in isomorfeus-preact-10.5.8 vs node_modules/preact/compat/src/render.js in isomorfeus-preact-10.5.9

- old
+ new

@@ -8,12 +8,14 @@ export const REACT_ELEMENT_TYPE = (typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) || 0xeac7; -const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/; +const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/; +const IS_DOM = typeof document !== 'undefined'; + // Input types for which onchange should not be converted to oninput. // type="file|checkbox|radio", plus "range" in IE11. // (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range") const onChangeInputType = type => (typeof Symbol != 'undefined' && typeof Symbol() == 'symbol' @@ -110,16 +112,21 @@ let props = vnode.props; let normalizedProps = props; // only normalize props on Element nodes if (typeof type === 'string') { + const nonCustomElement = type.indexOf('-') === -1; normalizedProps = {}; for (let i in props) { let value = props[i]; - if (i === 'value' && 'defaultValue' in props && value == null) { + if (IS_DOM && i === 'children' && type === 'noscript') { + // Emulate React's behavior of not rendering the contents of noscript tags on the client. + continue; + } + else if (i === 'value' && 'defaultValue' in props && value == null) { // Skip applying value if it is null/undefined and we already set // a default value continue; } else if ( i === 'defaultValue' && @@ -143,10 +150,10 @@ !onChangeInputType(props.type) ) { i = 'oninput'; } else if (/^on(Ani|Tra|Tou|BeforeInp)/.test(i)) { i = i.toLowerCase(); - } else if (CAMEL_PROPS.test(i)) { + } else if (nonCustomElement && CAMEL_PROPS.test(i)) { i = i.replace(/[A-Z0-9]/, '-$&').toLowerCase(); } else if (value === null) { value = undefined; }