Astro unexpectedly stringifies undefined
class attribute
#11413
Labels
needs triage
Issue needs to be triaged
undefined
class attribute
#11413
Astro Info
If this issue only occurs in one browser, which browser is a problem?
n/a
Describe the Bug
When using the When using the
'where'
or'class'
scopedStyleStrategy
, an undefined class attribute passed down to a child component is incorrectly stringified.For example,
<ChildComponent class={undefined} />
can receiveundefined astro-XXXX
as the value ofAstro.props.class
. (Assuming the parent component is also using scoped styles and therefore has an associated hash ID.)What's the expected result?
<ChildComponent class={undefined} />
should receive onlyastro-XXXX
as the value ofAstro.props.class
, withoutundefined
appearing in the class string.Notes
undefined
class starlight#2086Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-i2qay8?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: