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

How to create a textInput for the expiration date of a credit card with this format: MM/YY in react native

$
0
0

Could someone help me to create a textInput for the expiration date of a credit card with this format: MM/YYI'm programming with react native and typescript, I installed react-native-masked-text libraryMy doubt is how to put the month and the year in a single variable, in the database and in another file I have declared the month and the year separately, I have it like this:

const [cardMM, setcardMM]...const [cardYY, setcardYY]...<TextInputMask     type='custom'     value={}     options={{ mask: 'MM/YY' }}     keyboardType='numeric'     style={{ color: 'white', top: 35 }}     onChangeText={() => ()}   />

I don't know how the value and the onChangeText would go because I have the month and the year separatelyI would really appreciate your help!!


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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