1interface IProps_Square {
2 message: string;
3 onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
4}
1handleChange(e: React.ChangeEvent<HTMLInputElement>) {
2 // No longer need to cast to any - hooray for react!
3 this.setState({temperature: e.target.value});
4 }
5
6 render() {
7 ...
8 <input value={temperature} onChange={this.handleChange} />
9 ...
10 );
11 }
1onClick={(event: React.MouseEvent<HTMLElement>) => {
2 makeMove(ownMark, (event.target as any).index)
3}}
1// onSubmit or handleSubmit
2handleSubmit(eventL FormEvent<HTMLFormElement>) {
3
4}