I'm using react-native-text-input-mask
library in my React-Native project. react-native-text-input-mask
is one of the good libraries to add the text input mask for React-Native on iOS and Android. It works well on iOS but on Android, I see affineFormats
error. How can I fix this error?
Here is my code.
<TextInputMask
style={commonStyles.textInput}
value={phoneNumber}
placeholderTextColor="darkgray"
placeholder="Phone #"
keyboardType="phone-pad"
mask={"+1 ([000])-[000]-[0000]"}
onChangeText={setPhoneNumber}
/>
The solution is to add the missing props.
<TextInputMask
onChangeText={onChangeText}
value={value}
affineFormats={[]}
customNotations={[]}
affinityCalculationStrategy={'WHOLE_STRING'}
mask={"[000].[000].[000]"}
/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.