Created
November 29, 2017 22:29
-
-
Save srkirkland/b4e7e8f3b3037398d5680b1f4dba6b6a to your computer and use it in GitHub Desktop.
failing typescript stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. | |
Please check the code for the HelloWorld component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
// Provider | |
export default class HelloWorld extends React.Component<{}, any> { | |
constructor(props: any) { | |
super(props); | |
this.state = { name: "" }; | |
} | |
handleChange(event: any): void { | |
this.setState({ name: "Charles" }); | |
} | |
render() { | |
return ( | |
<div> | |
Hello {this.state.name}! | |
<button name="Update" onClick={e => this.handleChange(e)}> | |
Update | |
</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment