Skip to content

Commit d312d0f

Browse files
committed
Clone props passed-in to DOM components (fixes #8)
1 parent 5a9efd8 commit d312d0f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/React/DOM.purs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ module React.DOM where
66
" function mkDOM(tagName) { \
77
\ var ctor = React.DOM[tagName]; \
88
\ return function(props) { \
9-
\ props.type = props.attrType; \
10-
\ delete props.attrType; \
119
\ return function(children) { \
12-
\ return ctor.apply(ctor, [props].concat(children)); \
10+
\ var p = {}; \
11+
\ for (var k in props) { \
12+
\ p[k] = props[k]; \
13+
\ } \
14+
\ p.type = p.attrType; \
15+
\ delete p.attrType; \
16+
\ return ctor.apply(ctor, [p].concat(children)); \
1317
\ } \
1418
\ } \
1519
\ }"

0 commit comments

Comments
 (0)