Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How do I add a mask to TextInput in React Native using React Hook Form?

$
0
0

I'm trying to add a mask in user height input, I know how I should use this in ReactJS but I have no idea how to use it in React Native + React Hook Form.

Anyone can help me with this?I don't want to use an external lib to control my input.

My code:

<InputForm    control={control}    name="height"    label="Altura *"    placeholder="1,67"    error={errors.height && errors.height.message}    keyboardType="numeric"    maxLength={3}/>

This is the regex I'm trying to use: ^(0|[1-9]\d*)(,\d+)?$


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>