Skip to content

Commit 78c91f3

Browse files
events types
1 parent 3df07ad commit 78c91f3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Reactevents.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class Reactevents extends React.Component {
2+
constructor(props)
3+
{
4+
super(props);
5+
this.state={type:""}
6+
this.onEvent=this.onEvent.bind(this);
7+
}
8+
onEvent(e)
9+
{
10+
this.setState({type:e.type})
11+
}
12+
render() {
13+
return (
14+
<div>
15+
Hello {this.props.name}
16+
<textarea onCopy={this.onEvent} onCut={this.onEvent} onChange={this.onEvent} onBlur={this.onEvent} onFocus={this.onEvent} cols="20" rows="10"/>
17+
{this.state.type}
18+
</div>
19+
);
20+
}
21+
}
22+
23+
ReactDOM.render(
24+
<Reactevents name="Taylor" />,
25+
mountNode
26+
);

0 commit comments

Comments
 (0)