S
SolidJS3mo 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
thetarnav3mo 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
Kevv3mo ago
Agree, should I open a GH issue, or is this post enough?
thetarnav
thetarnav3mo ago
issues are great
Maciek50322
Maciek503223mo 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
Maciek503223mo ago
No description
Want results from more Discord servers?
Add your server
More Posts
How can I protect nothing ever breaks, while the setTimeout is waiting```tsx createEffect(() => { if (puzzle_lala().is_revealed && is_jump_to_next_puzzle_immeCanonical way to handle exceptions in async functions to perform redirect?Hi folks, I'm very new to solid and frontend development hence my question. I have a class that talk[solved]Issue with Solid Start MDX Project: 404 Error for New PageHello, I have created a Solid Start project using the “with MDX” mode. By default, the navigation inTrying SolidJS + Deno + ViteJS + Solid-Router + TailwindCSS, would love some help :)Hello, all 😄 I'm trying to run SolidJS with Deno & ViteJS, thus I'm using a new plugin made by commHow to css preloadingWhen the file weighs a lot, I don’t immediately see the application of styles on the site. I connecHandling of sensitive information from the front endHello, I am new in front end, now I am trying to make some components, that are shown/hidden dependiResource with async cacheWhats the pattern for using resources with caching that may be async? What I mean by that is that myGetting this error - TypeError: Cannot read properties of null (reading '_isDirty')Hi all! I am trying to create a simple home page using lighting Solid JS something like a netflix pDerived signals with args?Docs says that we can create derived signals with functions like this: ```ts const double = () => 2 JS Full stack framework designed web vs API fetch use webI would like to know what are new features available in JS Full stack web DreamWorks than API data f