How to Use State in React Functional Components
React components can have internal "state", a set of key-value pairs that belong to the component. When the state changes, React renders the component. Historically, state could only be used in class components. Using square brackets,…