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.

dangerouslySetInnerHTML?

See original GitHub issue

In React, you can set inner HTML with something like:

<div dangerouslySetInnerHTML={{__html: 'my markup'}} />

but preact doesn’t seem to support this? Any tips on how to achieve something similar?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

24reactions
jwaltoncommented, Feb 1, 2016

You, sir, are a scholar and a gentleman. 😃

2reactions
developitcommented, Feb 7, 2016

Now generally available as of 3.2.

Read more comments on GitHub >

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

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