import React,{useState} from 'react'
//Declare multiple states as a single object
let [userData,setUserData]=useState({
email:'',
password:'',
})
//handler function
const handleChange = (event) => {
event.preventDefault()
const value=event.target.value
setUserData({...userData,[event.target.name]:value});
}
function ExampleWithManyStates() {
// Declare multiple state variables!
const [age, setAge] = useState(42);
const [fruit, setFruit] = useState('banana');
const [todos, setTodos] = useState([{ text: 'Learn Hooks' }]);
// ...
}