react intro

This commit is contained in:
Micah Godbolt
2019-02-22 18:19:35 -08:00
parent d762f6ba5a
commit 9a27b7038e
2 changed files with 98 additions and 16 deletions

View File

@@ -14,14 +14,12 @@ export class Counter extends React.Component<any, any> {
return (
<div>
{text}: {counter}
<Button
onClick={() => {
this.setState({ counter: counter + 1 });
}}
>
Click
</Button>
<Button onClick={this._onButtonCLick}>Click</Button>
</div>
);
}
_onButtonCLick = () => {
this.setState({ counter: this.state.counter + 1 });
};
}