Skip to content

Instantly share code, notes, and snippets.

@tyler-dot-earth
Last active January 4, 2016 06:49
Show Gist options
  • Save tyler-dot-earth/4e08a0ee1418f353ef5b to your computer and use it in GitHub Desktop.
Save tyler-dot-earth/4e08a0ee1418f353ef5b to your computer and use it in GitHub Desktop.
Form component task.js
// In the parent component ...
render() {
let myOnSuccessFunction = function({word, color}) {
alert('word: ', word)
alert('color: ', color)
}
return (
<ColorWordForm
onSave={myOnSuccessFunction}
/>
)
}
// Your task: write the ColorWordForm component.
// - It should use the onSave function when the form is "saved" (submitted).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment