Skip to content Skip to sidebar Skip to footer

Property 'blur' Does Not Exist On Type 'input'

I am using the useRef hook to pass a ref property into my custom FieldInput component. This is then used for the validation of my form. const fieldRef = useRef(); ... const han

Solution 1:

Ok, so first of all, in your FieldInput component, you passed those event handlers to Input like this : <Input onCahnge={callback()}/> , instead of doing it like this : <Input onChange={()=>callback()}/> . Instead of passing your callbacks, you called them and passed in their result as the event handlers. This caused an error in your component.

After fixing that and getting type hints working, blur was still signaled by the editor as missing from type Input. After looking over the docs, and trying to console log the ref element, it seems like there is actually no blur method exposed. TextField from react-native has it exposed, but is not forwarded to native-baseInput

Post a Comment for "Property 'blur' Does Not Exist On Type 'input'"