Skip to content

Instantly share code, notes, and snippets.

@codingnninja
Last active August 5, 2019 17:01
Show Gist options
  • Save codingnninja/6fcf40392767745e296779b0f197dc20 to your computer and use it in GitHub Desktop.
Save codingnninja/6fcf40392767745e296779b0f197dc20 to your computer and use it in GitHub Desktop.
Add food item to the store
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