Skip to content

Instantly share code, notes, and snippets.

@CodingItWrong
Created January 4, 2019 02:40
Show Gist options
  • Select an option

  • Save CodingItWrong/4c9b6fcbf112dfa8ef8ccd33ff8ab55e to your computer and use it in GitHub Desktop.

Select an option

Save CodingItWrong/4c9b6fcbf112dfa8ef8ccd33ff8ab55e to your computer and use it in GitHub Desktop.
export default class NewMessageForm extends Component {
state = { inputText: '' }
handleChangeText = (text) => {
this.setState({ inputText: text });
}
+ handleSend = () => {
+ this.setState({ inputText: '' });
+ }
+
render() {
...
<Button
title="Send"
testID="sendButton"
+ onPress={this.handleSend}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment