I have a react component where i want to call same arrow function with different arguments, but i am stuck on how to pass argument to it, now i am questioning myself can i do it ?
function Register(props) {
const handleChange = (event) => {
// here i want receive multiple arguments here eg. fromText1, fromText2
}
return (
<React.Fragment>
<TextField
...
onChange={handleChange} // handleChnage('fromText1');
/>
<TextField
...
onChange={handleChange} // handleChnage('fromText2');
/>
....
</React.Fragment>
);
}