Created
October 5, 2020 09:35
-
-
Save arthurvi/3bc102882e381a0b827d7e291ac04d0d to your computer and use it in GitHub Desktop.
Item.jsx
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 Item = React.memo(function Item({ id, value, isSaving, onChange, onSave }) { | |
if (isSaving) { | |
return <li>Saving...</li>; | |
} | |
return ( | |
<li> | |
<input | |
value={value} | |
onChange={(event) => onChange(event.target.value)} | |
/> | |
<button onClick={onSave}>Save</button> | |
</li> | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment