#How to pass a function and also a statement inside the onChange event
2 messages · Page 1 of 1 (latest)
I'm not sure if this solves your specific problem, but you could pass that variable into your function:
function handleNumChange(event, text){
//do whatever you need with event
if(text) secondInput.current.focus();
}
return(
<div onChange={ (e) => handleNumChange(e,text) } />
)
}}