dangerouslySetInnerHTML?
See original GitHub issueIs there an equivalent to react’s dangerouslySetInnerHTML
? I’m currently using onCreate{e => e.innerHTML = '...'}
for this purpose.
It’s not a good solution though, since it flickers when updating.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
DOM Elements - React
dangerouslySetInnerHTML is React's replacement for using innerHTML in the browser DOM. In general, setting HTML from code is risky because it's easy to ......
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.
Read more >React.js: Set innerHTML vs dangerouslySetInnerHTML
Since innerHTML is a native method that binds the SVG code directly to the DOM without considering anything. On the other hand, ...
Read more >DangerouslySetInnerHTML in React JS Explained
dangerouslySetInnerHTML is an attribute under DOM elements in React. According to the official documentation, dangerouslySetInnerHTML is React's replacement ...
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.
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
@dodekeract It’s difficult to process this issue as it’s not clear what should be done. If you want to change the API, you must provide an example where the current API falls short, like #117 led to #141.
I know Vue.js uses a
v-html
directive which is basically doing the same thing. Seems like a common edge case that should have it’s own method or at least documented on how to accomplish it.