put all the input values in a single object

PHOTO EMBED

Sat Jul 16 2022 19:30:34 GMT+0000 (Coordinated Universal Time)

Saved by @gazifahad #javascript

const initialState={firstName:'',lastName:'',email:'',password: '',confirmPassword:''}

 const [formData,setFormData]=useState(initialState)

const handleChange = (e) => {
(\\https://www.youtube.com/watch?v=VsUzmlZfYNg&t=12191s//)
            setFormData({...formData,[e.target.name]:e.target.value})
    };
content_copyCOPY

use that onchange in all the inputs

https://www.youtube.com/watch?v=VsUzmlZfYNg&t=12191s