Last active
August 26, 2019 12:56
-
-
Save JamesZoft/259a9456ba1064f7cb65d311cbe7d74a 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
const saveStuffToBackend = stuff => { | |
saveToBackend(stuff); | |
} | |
const genRowPartial = (foo) => (bar) => { | |
const [baz, setBaz] = useState(0); | |
return ( | |
<tr><td><input value={baz} onChange={e => setBaz(e.target.value)} onBlur={() => saveStuffToBackend(baz)} /></td></tr> | |
); | |
} | |
const MyComponent = props => { | |
const genRow = genRowPartial(props.stuff); | |
return ( | |
<table><tbody> | |
{props.stuff.map(el => genRow(el))} | |
</tbody></table> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment