What is the correct way to declare and initialize a state variable using the useState hook?
const [count, setCount] = useState(0);
const [state, setState] = useState({name: "John", age: 25});
const [name, setName] = useState();
const count = useState(0);
The useState hook is used to declare and initialize a state variable in React Hooks. The correct way to declare a state variable is by using the array destructuring syntax: const [variable, setVariable] = useState(initialValue);. useState returns an array with exactly two values: the current state and the set function. In the given answers, options C and D follow this syntax and are correct. Options A and B are incorrect because it does not use the array destructuring syntax and does not include the setter function.