Skip to content

Commit

Permalink
Fix dangerouslySetInnerHTML in JSX mode (Fixes #42) (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
developit authored Sep 15, 2017
1 parent 3177a48 commit aa18e65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ let prettyFormatOpts = {

function attributeHook(name, value, context, opts, isComponent) {
let type = typeof value;

// Use render-to-string's built-in handling for these properties
if (name==='dangerouslySetInnerHTML') return false;

// always skip null & undefined values, skip false DOM attributes, skip functions if told to
if (value==null || (type==='function' && !opts.functions)) return '';
Expand Down

0 comments on commit aa18e65

Please sign in to comment.