S
SolidJS8mo ago
Kevv

Seems like I found a JSX bug

As long I know, you can add up variables and raw text inside a tag, something like: <p>{myVar} people</p> but if you do that in a SVG's <text> element inside a <For> loop it will throw an error, here is it in the playground: https://playground.solidjs.com/anonymous/c5ffdd2c-b93e-469d-bfc7-e5e49d95ba17 If you delete the % symbol, it will work normally. Is it a bug? or am I breaking some JSX rule?
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
5 Replies
thetarnav
thetarnav8mo ago
Looks like a bug to me The compiler just throws and in a weird way not in the usual "found unexpected token" way not sure if thats a bug in dom-expressions or babel
Kevv
KevvOP8mo ago
Agree, should I open a GH issue, or is this post enough?
thetarnav
thetarnav8mo ago
issues are great
Maciek50322
Maciek503228mo ago
something with children when it loses track of svg: - if you swap out inner's text children {d}% with {d + "%"} it works, - if you wrap inner text in svg it works <svg><text x={0} y={i()*20 + 40} fill="currentColor">{d}%</text></svg> Yeah same message if you do just <text> outside <svg> (with {signal} text as children ) Another thing, this works too strangely, but generates value in wrong order
<text x={0} y={i()*20 + 40} fill="currentColor">{d}{""}%</text>
<text x={0} y={i()*20 + 40} fill="currentColor">{d}{""}%</text>
Maciek50322
Maciek503228mo ago
No description
Want results from more Discord servers?
Add your server