- Get started by editing
- app/page.js
-
- Docs{' '} - - -> - -
-- Find in-depth information about Next.js features and API. -
- + // submiting the form + const submitHandler = (e) => { + e.preventDefault(); // prevent the form from submitting + setMainTask([...mainTask, { title, desc }]); + console.log(mainTask); + setTitle(""); + setDesc(""); + }; - -- Learn{' '} - - -> - -
-- Learn about Next.js in an interactive course with quizzes! -
- + // delete the task + const deleteHandler = (i) => { + let copyTask = [...mainTask]; + copyTask.splice(i, 1); + setMainTask(copyTask); + }; - -- Templates{' '} - - -> - -
-- Explore the Next.js 13 playground. -
- + // displaying the task + let renderTask =No task available
; + if (mainTask.length > 0) { + renderTask = mainTask.map((t, i) => { + return ( +{t.title}
+{t.desc}
+ +- Deploy{' '} - - -> - -
-- Instantly deploy your Next.js site to a shareable URL with Vercel. -
- + return ( + <> ++ Edson's Todo List +
+ ++
- {renderTask}