js updates

This commit is contained in:
Micah Godbolt
2019-02-22 12:21:40 -08:00
parent 3ef69dc570
commit 4f7b9e4747
46 changed files with 200 additions and 144 deletions

View File

@@ -1,27 +1,11 @@
import React from 'react';
import { Button } from './Button';
export class Counter extends React.Component<{ text: string }, { counter: number }> {
constructor(props) {
super(props);
this.state = {
counter: 0
};
}
export class Counter extends React.Component<any, any> {
render() {
const { counter } = this.state;
const { text } = this.props;
return (
<div>
{text}: {counter}
<Button
onClick={() => {
this.setState({ counter: counter + 1 });
}}
>
Click
</Button>
</div>
);
}
}