Reagent
GuideAPIChangelogGitHub
  • Documentation index
  • Getting Started
  • Reagent 2
    • What's new in 2.0
    • Upgrading to 2.0
  • Learn
    • Using Hiccup to Describe HTML
    • Creating Reagent Components
    • Square brackets vs parentheses
    • When do components update?
    • Managing State
    • Batching and Timing
    • Controlled Inputs
    • Best Practices (draft)
  • Reference
    • Interop with React
    • React Features
    • Reagent Compiler
    • Web Components (Custom Elements)
    • React Renderers
    • Server Side Rendering
    • React 19 and Reagent
    • Security
  • FAQ
    • Component not re-rendering
    • Using refs
    • Entities like nbsp
    • HTML entities
    • Missing attributes
    • dangerouslySetInnerHTML
    • Forcing re-creation
    • Broken after updating deps
  • Older versions
    • Upgrading to 1.2
    • Upgrading to 1.1
    • Upgrading to 1.0
    • Upgrading to 0.8
  • More
    • Example: Material-UI
    • Example: Smooth UI
    • Development guide
  • API
    • API reference
    • reagent.core
    • reagent.dom.client
    • reagent.dom
    • reagent.dom.server
    • reagent.ratom
    • reagent.hooks

Not reviewed yet: this page may be outdated or inconsistent with the other guides. The API reference is generated from the current source.

How can I use React's dangerouslySetInnerHTML?

See React's dangerouslySetInnerHTML documentation.

A minimal (contrived example):

[:div
 {:dangerouslySetInnerHTML
  (r/unsafe-html "<image  height=\"600\" src=\"https://static1.squarespace.com/static/58f9c2fbd2b85759c7e4ec2f/5923cbe4be6594d8a0b033a9/5a0154a6ec212d85ddf7941f/1511246183022/mfsprout_20160406_1234-Print.jpg?format=1500w\"/>")}]

See Security.


Up: FAQ Index

Edit this page on GitHub

GitHub · cljdoc · #reagent on Clojurians Slack · Archive