Closed vaibhav135 closed 2 years ago
Cause the inputRef
receives a callback ref as its' props, you can not pass ref
directly into it. Maybe you need to create a ref first, then pass a callback into the inputRef
. For example,
const inputRef = useRef<HTMLInputElement | null>(null);
const setInputRef = useCallback((inputElement: HTMLInputElement | null) => {
inputRef.current = inputElement;
}, []);
<AutosizeInput inputRef={setInputRef} />
@pjchender thanks it worked!
Hi, I am using this package with type-definitions from here and just wanted to how I can pass ref. I have made a forward ref and passing that ref to this. I am currently passing the ref to inputRef. But it is giving me this error :-