blob: 30f7281bbebb9a9b0dc0882b2ba6d74433d45dc7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import * as React from 'react';
export class Counter extends React.Component<{}, { counter: number }> {
constructor(props: {}) {
super(props);
this.state = {
counter: 0
};
}
render() {
return (
<button onClick={ () => this.setState({ counter: this.state.counter + 1 }) }>{ this.state.counter }</button>
)
}
}
|