how we can define usesate in react code example
Example 1: update state in useState hook
// declare state using useState hook.
// someState is set to someInitialState
const [someState, setSomeState] = useState(someInitialState);
// setSomeState updates the current state
setSomeState(someOtherState);
Example 2: usestate react
function Example(props) {
// You can use Hooks here!
return <div />;
}