Skip to content

Add support for dangerouslySetInnerHTML #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ithinkihaveacat
Copy link
Contributor

Using the dangerouslySetInnerHTML attribute disables automatic escaping of &<>"'; see https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml.

@AndrewLeedham
Copy link

Can this be closed given #12

@ithinkihaveacat
Copy link
Contributor Author

@AndrewLeedham Yep!

@elirov
Copy link

elirov commented Jun 23, 2020

any chance we could add an example of how to use dangerouslySetInnerHTML? I'm stumped..

@elirov
Copy link

elirov commented Jun 23, 2020

const content = '<b>html test</b>';
console.log(h('div', { dangerouslySetInnerHTML: { __html: content } }));

@AndrewLeedham
Copy link

const content = '<b>html test</b>';
console.log(h('div', { dangerouslySetInnerHTML: { __html: content } }));

Yes you've got it https://runkit.com/embed/4379f3hphgv4

AndrewLeedham added a commit to AndrewLeedham/vhtml that referenced this pull request Jun 23, 2020
odinhb pushed a commit to dodoas/stringjsx that referenced this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants