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
Attributes with an undefined runtime value are treated differently in SSR than they are in client rendering. In client rendering, attributes are completely removed when the value is undefined but in SSR, sometimes the attribute is serialized with "" and sometimes its serialized as string"undefined".
In my particular example, I'm using aria-describedby, where a valid ID is required (and in my particular case, isn't known until the client hydrates so SSR without the attribute is desirable).
See example, I have static div, <Dynamic /> and a custom component using spread. Custom component and Dynamic seem to behave the same but I've included both just in case.
Expected behavior
I'm not sure what is correct behavior here, tbh. i definitely think string "undefined" is no good but because of how clever the compiler is at "precompiling" the static bits of the string (in this case the aria-describedby= part), I'm not sure "" is wrong. Though for this particular attribute, i think an HTML validator/spec checker will complain about the empty string.
Screenshots or Videos
No response
Platform
OS: mac, node v16
Browser: all
Version: 1.3.15
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Attributes with an
undefined
runtime value are treated differently in SSR than they are in client rendering. In client rendering, attributes are completely removed when the value isundefined
but in SSR, sometimes the attribute is serialized with""
and sometimes its serialized as string"undefined"
.In my particular example, I'm using
aria-describedby
, where a valid ID is required (and in my particular case, isn't known until the client hydrates so SSR without the attribute is desirable).Your Example Website or App
https://playground.solidjs.com/?hash=-776479397&version=1.3.13
Steps to Reproduce the Bug or Issue
See example, I have static div,
<Dynamic />
and a custom component using spread. Custom component andDynamic
seem to behave the same but I've included both just in case.Expected behavior
I'm not sure what is correct behavior here, tbh. i definitely think string
"undefined"
is no good but because of how clever the compiler is at "precompiling" the static bits of the string (in this case thearia-describedby=
part), I'm not sure""
is wrong. Though for this particular attribute, i think an HTML validator/spec checker will complain about the empty string.Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: