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

Function handleSubmitToDo

examples/rsp-webpack-4/src/BodyContent.js:27–38  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

25
26 //functions for the To-Do list
27 function handleSubmitToDo(e) {
28 e.preventDefault();
29
30 if (value.length > 0) {
31 setList(prevListArray => {
32 return [...prevListArray, {id: count.current, task: value}];
33 });
34
35 count.current = count.current + 1;
36 }
37 setValue(''); //clears text field on submit
38 }
39
40 function updateCompleted(complete) {
41 setCompleted(prevListArray => {

Callers

nothing calls this directly

Calls 1

setValueFunction · 0.50

Tested by

no test coverage detected