I've been working on creating a custom Input component in react native using typescript for the react-hook-form library.
type CustomInputProps = {
name: any,
control: any
}
const CustomInput: FC<CustomInputProps> = ({name, control, ...props}) => {
const {field} = useController({
name,
defaultValue: '',
control
})
return (
<TextInput
value={field.value}
onChangeText={field.onChange}
{...props}
/>
)
}
In the above code, what should I include in CustomInputProps ? Also, I'm interested in extending TextInput's Props. Any suggestions?
PS: What are your thoughts on using TypeScript in react native? I find it quite verbose, especially when dealing with react navigation and other aspects...