Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 23, 2022 03:59 am GMT

UseState Hook React

UseState Hook

The React useState Hook allows us to track state in a function component.

State generally refers to data or properties that need to be tracking in an application.

import React,{useState} from 'react';function Example(){const [count,setCount] = useState(0);return(    <div>        <p>you have clicked {count} times</p>        <button onClick={()=> setCount(count+1)}>        Click Me        </button>    </div>    );}

Original Link: https://dev.to/harshilshah99/usestate-hook-react-2inf

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To