Render HTML from string
I have a string containing HTML tags which I want to render as HTML. For example, this can be accomplished in Svelte with a special
@html
directive: https://svelte.dev/tutorial/html-tags. However, I don't see a similarly straightforward way to accomplish this in SolidJS. Am I missing something?
Thanks!4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thanks for your reply. I should have mentioned that I tried the innerHTML prop already. It doesn't do what I described. It simply appends the unrendered text.
it should work. here are two approaches https://playground.solidjs.com/anonymous/61cfc0a2-701c-46d6-8901-730c851254ad
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
usual warning about security tho.. just be sure you know the input