Add React
This commit is contained in:
parent
0f3dc26291
commit
7e66a50d7c
|
|
@ -0,0 +1,21 @@
|
|||
class E extends React.Component {
|
||||
state = {
|
||||
e: "e"
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
window.setInterval(
|
||||
() =>
|
||||
this.setState(state => ({
|
||||
e: state.e + "e"
|
||||
})),
|
||||
100
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div style={{ background: "#eeeeee" }}>{this.state.e}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<E />, document.body);
|
||||
Loading…
Reference in New Issue