Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleItemUpdate = (event, index) => {
- const target = event.target;
- const value = target.value;
- const name = target.name;
- this.setState({
- items: this.state.items.map((item, itemIndex) => {
- if (itemIndex === index) {
- return {
- ...item,
- [name]: value
- }
- }
- return item;
- })
- });
- };
Add Comment
Please, Sign In to add comment