MCPcopy Create free account
hub / github.com/adobe/react-spectrum / removeItem

Function removeItem

examples/rsp-webpack-4/src/ToDoItems.js:4–13  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

2
3function TodoItems(props) {
4 function removeItem(id) {
5 //add selected item to the completed list
6 const found = props.list.find(element => element.id === id);
7 if (found) {
8 props.updateCompleted(found.task);
9 }
10
11 //remove the item from the list
12 props.handleList(props.list.filter(item => item.id !== id));
13 }
14
15 const elements = props.list.map(item => (
16 <Checkbox onChange={() => removeItem(item.id)} key={item.id} value={item.task}>

Callers

nothing calls this directly

Calls 1

filterMethod · 0.65

Tested by

no test coverage detected