Skip to content

Instantly share code, notes, and snippets.

@CodingItWrong
Created January 4, 2019 02:39
Show Gist options
  • Save CodingItWrong/e98cdd70e91a578d16f412c79ad19cbc to your computer and use it in GitHub Desktop.
Save CodingItWrong/e98cdd70e91a578d16f412c79ad19cbc to your computer and use it in GitHub Desktop.
export default class NewMessageForm extends Component {
+ state = { inputText: '' }
+
+ handleChangeText = (text) => {
+ this.setState({ inputText: text });
+ }
+
render() {
+ const { inputText } = this.state;
return (
<View>
<TextInput
+ value={inputText}
testID="messageText"
+ onChangeText={this.handleChangeText}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment