// Get all input value by onKeyUp event using one function
const [student, setStudent] = useState({});
const setStudentValue = (e) => {
let set = {};
set[e.target.name] = _.trim(e.target.value);
setStudent({
...student,
...set
});
}
// <input type="text" name="firstName" onKeyUp={setStudentValue} />
// set data
// {firstName: ""} - output