Skip to content

Commit aa18e65

Browse files
authored
Fix dangerouslySetInnerHTML in JSX mode (Fixes #42) (#46)
1 parent 3177a48 commit aa18e65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jsx.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ let prettyFormatOpts = {
2222

2323
function attributeHook(name, value, context, opts, isComponent) {
2424
let type = typeof value;
25+
26+
// Use render-to-string's built-in handling for these properties
27+
if (name==='dangerouslySetInnerHTML') return false;
2528

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

0 commit comments

Comments
 (0)