This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
<Playground /> doesn't like '$' #201
Labels
bug
Something isn't working
Comments
$
This also happens with backticks. <Playground>
`This doesnt work`
<MyComponent didMount={()=>{
alert(`This also doesnt work`)
}} />
</Playground> Looks like the issue is here I'm working on a fix, should have a PR soon 😄 |
Hi @kentcdodds, this happens because we inject the children as a <Playground __position={1} __code={`This is a some ${1 + 1} content`}>
This is a some ${1 + 1} content
</Playground> So, if you wanna try to put In the beginning, I tried to use jsx-to-string to make this works, but it has some bugs when you use render props, so I need to use this approach. I think that is not the best one, but was the only way that came to my mind 😕 |
Fixed on the new v0.10.0 🚀 |
Thank you! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug Report
Describe the bug
Source:
Result:
Source:
Result:
Expected behavior
I expect that the playground result for the $ in single quotes will render properly, but it does not.
My guess is there's some regex magic going on and the source isn't being properly escaped.
The text was updated successfully, but these errors were encountered: