Last active
August 5, 2019 17:01
-
-
Save codingnninja/6fcf40392767745e296779b0f197dc20 to your computer and use it in GitHub Desktop.
Add food item to the store
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
import React from 'react' | |
const AddFoodItemForm = props => { | |
return ( | |
<form onSubmit={ props.addFoodItem } className="col-sm-4"> | |
<div> | |
<div> | |
<label className="text-white">Food name</label> | |
<input type="text" name="food" value={props.food} onChange={ props.handleInputChange}/> | |
</div> | |
<div> | |
<label className="text-white">Food cost</label> | |
<input type="number" name="cost" value={props.cost} onChange={ props.handleInputChange} /> | |
</div> | |
<button> Add food item </button> | |
</div> | |
</form> | |
) | |
} | |
export default AddFoodItemForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment