Skip to content

Instantly share code, notes, and snippets.

@codingnninja
Last active August 5, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingnninja/27a8543e079a68d7f0fc3694f58edb1e to your computer and use it in GitHub Desktop.
Save codingnninja/27a8543e079a68d7f0fc3694f58edb1e to your computer and use it in GitHub Desktop.
Edit food item
import React from 'react'
const EditFoodItemForm = props => {
return (
<form 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 onClick={ props.updateFoodItem }> Update </button>
<button onClick={() => props.setEditing(false)}>Cancel</button>
</div>
</form>
)
}
export default EditFoodItemForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment