Astro v4.11.5
Node v18.20.3
System Linux (x64)
Package Manager npm
Output static
Adapter none
Integrations none
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 receive undefined astro-XXXX as the value of Astro.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 only astro-XXXX as the value of Astro.props.class, without undefined appearing in the class string.
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
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-i2qay8?file=src%2Fpages%2Findex.astro
Participation