You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overrided property by undefined in mergeProps #1383
Just wanted to note that this change caused an issue for me. The specific thing I was trying to do:
// Replace `invalid` with `aria-invalid` since `invalid` isn't a proper HTML attribute<input{...props}aria-invalid={props.invalid}invalid={undefined}/>
The expectation was that this would work because { ...({ foo: 'bar' }), ...({ foo: undefined }) } replaces the foo property with undefined in plain JavaScript. There are workarounds around (use null or splitProps instead) but this behavior was a bit unexpected.
Activity
orenelbaum commentedon Dec 3, 2022
This issue happens only with SSR. It doesn't happen in a normal Solid project or with Solid Start with SSR turned off.
ryansolid commentedon Dec 3, 2022
It's a DOM Expressions problem. But I consider SSR in Solid's responsibility. SolidStart is just a template/cli/collection of Vite plugins.
orenelbaum commentedon Dec 3, 2022
I actually found the problem, it's in the server version of mergeProps, I'll fix it, I just want to make sure I fix it properly
orenelbaum commentedon Dec 3, 2022
Another fun bug, if you replace the props object with:
With ssr you'd get the value 2 but without ssr you'd get the value 1.
If you go instead with
With ssr you'd get the value 2 again but without ssr it will throw an error.
orenelbaum commentedon Dec 4, 2022
I'll link this here for now
ryansolid/dom-expressions@9d43854
fongandrew commentedon Jan 15, 2025
Just wanted to note that this change caused an issue for me. The specific thing I was trying to do:
The expectation was that this would work because
{ ...({ foo: 'bar' }), ...({ foo: undefined }) }replaces thefooproperty with undefined in plain JavaScript. There are workarounds around (usenullorsplitPropsinstead) but this behavior was a bit unexpected.fix solidjs#1383 server undefined, fix solidjs#1380 infinite forms