Skip to content

Instantly share code, notes, and snippets.

@andrewrjohn
Last active June 6, 2017 02:25
Show Gist options
  • Save andrewrjohn/c3fc6c88ef5aa800fb57adb92f34c6eb to your computer and use it in GitHub Desktop.
Save andrewrjohn/c3fc6c88ef5aa800fb57adb92f34c6eb to your computer and use it in GitHub Desktop.
kettleapp
onChangeText={text => this.updateContent(text)}
updateContent(newText) {
this.setState({ contentText: newText });
firebase.database().ref('kettles/' + this.state.currentKettle + '/').set({
content: newText
});
}
@kevinejohn
Copy link

One note, I would move the function in:

onChangeText={text => {
    this.setState({ contentText: text });
    firebase.database().ref('kettles/' + this.state.currentKettle + '/').set({
      content: text
    });
}}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment