Easy
In a React form component, fill in the missing code to properly handle form submission
1function RegistrationForm() {2 const [formData, setFormData] = useState({3 username: '',4 email: ''5 });67 const handleChange = (e) => {8 const { name, value } = e.target;9 setFormData(prev => ({10 ______ // Missing code here11 }));12 };1314 return (15 <form onSubmit={(e) => e.preventDefault()}>16 <input17 name="username"18 value={formData.username}19 onChange={handleChange}20 />21 <input22 name="email"23 value={formData.email}24 onChange={handleChange}25 />26 </form>27 );28}