Create dangerouslySetInnerHTML.md

This commit is contained in:
Mike Thompson 2018-02-13 15:14:26 +11:00 committed by GitHub
parent e7fca055b6
commit 23306897d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
### Question
How can I use React's [dangerouslySetInnerHTML](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml) feature?
### Answer
A minimal (contrived example):
```clj
[:div
{:dangerouslySetInnerHTML
{:__html "<image height=\"600\" src=\"https://static1.squarespace.com/static/58f9c2fbd2b85759c7e4ec2f/5923cbe4be6594d8a0b033a9/5a0154a6ec212d85ddf7941f/1511246183022/mfsprout_20160406_1234-Print.jpg?format=1500w\"/>"}}]
```
***
Up: [FAQ Index](README.md)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;