1var App = React.createClass({
2 handleParentClick: function (e) {
3 console.log('parent');
4 },
5
6 handleChildClick: function (e) {
7 e.stopPropagation();
8 console.log('child');
9 },
10
11 render: function() {
12 return <div>
13 <p onClick={this.handleParentClick}>
14 <span onClick={this.handleChildClick}>Click</span>
15 </p>
16 </div>;
17 }
18});
19
20ReactDOM.render(<App />, document.getElementById('root'));