diff --git a/src/App.js b/src/App.js index 3017066..0a76811 100644 --- a/src/App.js +++ b/src/App.js @@ -1,19 +1,40 @@ -import React from "react"; -import Greet from "./Greet"; -const App = () => { +import React, { useState } from "react"; +import "./App.css"; + +function App() { + const [tasks, setTasks] = useState([]); + const [input, setInput] = useState(""); + + const addTask = () => { + setTasks([...tasks, input]); + setInput(""); + }; + + const deleteTask = (index) => { + tasks.splice(index, 1); + setTasks([...tasks]); + }; + return (
This is a para
-No of tasks to be done : {tasks.length}
My age is {age}
-My gender is {gender}
- {props.children} - > - ); -}; -export default Greet;