Created
September 11, 2018 02:03
-
-
Save yomete/a8ec3247566c778e2ab98ff5140fccfc to your computer and use it in GitHub Desktop.
This file contains 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
class CustomTextInput extends React.Component<{}> { | |
handleSubmit = e => { | |
e.preventDefault(); | |
console.log(this.textInput); | |
}; | |
// tell Flow that we want to associate the textInput ref | |
// with an HTML Input button | |
textInput: ?HTMLInputElement; | |
render() { | |
return ( | |
<div> | |
<form onSubmit={e => this.handleSubmit(e)}> | |
<textarea ref={textInput => (this.textInput = textInput)} /> | |
<button>Submit</button> | |
</form> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment