I'm managing my forms using react-hook-form. but I also need to manage an element's click event. In this case, I have to set both refs
let inputRef = useRef(null);
const onClick = input => {
input.click();
};
<input
type="file"
ref={ref => {
inputRef = ref;
register();
}},
onClick={() => onClick(inputRef)}
></input>
How can I set multiple refs