Introduction
The useState hook in React allows you to add state variables to functional components. It returns a stateful value and a function to update it. Suppose you want to create a simple website with a text element that initially displays ‘Change me using a button’ and a button. When you click the button, it will change the text to ‘Changed’.
let’s do it using react:-