Skip to content

Commit a83f4db

Browse files
committed
Add destructuring assignment example
1 parent ac4320e commit a83f4db

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/dummy/app/assets/javascripts/harmony_example.js.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ var HarmonyComponent = React.createClass({
1010
},
1111
render: function(){
1212
var greeting = HarmonyComponent.generateGreeting();
13+
var { active, ...other } = { active: true, x: 1, y:2 }
1314
return (
14-
<h1 {...this.props}>{greeting}</h1>
15+
<div>
16+
<h1 {...this.props}>{greeting}</h1>
17+
<div active={active}>
18+
<span {...other} />
19+
</div>
20+
</div>
1521
)
1622
},
17-
});
23+
});

0 commit comments

Comments
 (0)