Text property doesn't render dangerouslySetInnerHTML
See original GitHub issueIn first I’d like to thank you for this great tool, I just noticed that text property doesn’t render dangerouslySetInnerHTML, could be please provide us with an example if this was already implemented.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
reactjs - dangerouslySetInnerHtml doesn't update during render
log shows that this.props.html is equal to '' a blank string, yet the UI doesn't update, and maintains the text that was originally...
Read more >Using dangerouslySetInnerHTML in a React application
dangerouslySetInnerHTML is a property that you can use on HTML elements in a React application to programmatically set their content. Instead of ...
Read more >Using dangerouslySetInnerHTML - Getting Started with DOM
dangerouslySetInnerHTML reactjs property can be a lifesaver when used for rendering HTML markups produced by a WYSIWYG editor.
Read more >When to use dangerouslySetInnerHTML in React? - Refine Dev
React dangerouslySetInnerHTML is an HTML property that makes it easy to programmatically set the HTML elements from an external source. It has ...
Read more >DOM Elements - React
Normally, there is a warning when an element with children is also marked as contentEditable , because it won't work. This attribute suppresses...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, I know. But in this case I think it steps in too much into user’s use case as I said. For example, to parse emojis and HTML like above we used
dangerouslySetInnerHTML+ a<span/>container, but I think that should be a choice of the user. He might want to do something else. I don’t see it as something thatreact-emoji-rendershould take care off. Maybe I’m wrong tho 😅Hello again !
So I have no idea why @tommoor wrote that in the documentation, I’m not aware of any issues about putting unicode inside
dangerouslySetInnerHTMLand the remaining string is just html, there shouldn’t be any problems. But we can sort around it if you like 😉I have setup a CodeSandbox example where I show one way of solving your problem putting the emojis inside
dangerouslySetInnerHTMLand one way of solving it without putting the emojis insidedangerouslySetInnerHTML. As expected, both solutions work, so I wonder the reason of that warning in the README 😅CodeSandbox example
I hope that helps !