Skip to content

Instantly share code, notes, and snippets.

@Ledoux
Last active April 8, 2019 23:50
Show Gist options
  • Save Ledoux/30123db203dec9639a6b1b96f42537e6 to your computer and use it in GitHub Desktop.
Save Ledoux/30123db203dec9639a6b1b96f42537e6 to your computer and use it in GitHub Desktop.
import React, { Fragment } from 'react'
const AddStock = ({ handleAddStock }) => {
const [available, setAvailable] = useState(0)
return (
<Fragment>
<input
onChange={event => setAvailable(event.target.value)}
value={available}
/>
<button onClick={handleAddStock(available)}>
Add
</button>
</Fragment>
)
}
export default AddStock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment