From 71b60e68bdf6e8fee0ff3914bd6d892f7bcad585 Mon Sep 17 00:00:00 2001 From: dadhichharshit22 Date: Sun, 22 Sep 2024 17:53:47 +0530 Subject: [PATCH] Update App.jsx --- src/App.jsx | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 56d5c344..848c36f6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,12 +1,31 @@ +import { useState } from "react"; import "./App.css"; function App() { + + //let count = 0; + const [count,setCount] = useState(0); + + function decrementHandler(){ + //count = count-1; + setCount(count-1); + } + function incrementHandler(){ + setCount(count+1); + } + function resetHandler(){ + setCount(0); + } return ( -
-

React & Tailwind CSS Starter Pack

-

This is a starter pack for React & Tailwind CSS projects.

- meme -
+
+
Increment && decrement
+
+ +
{count}
+ +
+ +
); }