question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text property doesn't render dangerouslySetInnerHTML

See original GitHub issue

In 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:closed
  • Created 5 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
enzofereycommented, Feb 8, 2019

What I thought about it is to keep toArray helper and offer a new react-emoji-render helper’s that can parse emojis and html in the same time.

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 that react-emoji-render should take care off. Maybe I’m wrong tho 😅

1reaction
enzofereycommented, Feb 6, 2019

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 dangerouslySetInnerHTML and 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 dangerouslySetInnerHTML and one way of solving it without putting the emojis inside dangerouslySetInnerHTML. As expected, both solutions work, so I wonder the reason of that warning in the README 😅

CodeSandbox example

I hope that helps !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found