In React-Native project, I have an Input component from Native Base and I want to this component to take only numeric values 0-9 and give this field default value, I looked for other questions about this issue, I do not know maybe those answers are for 'textInput' component or somehow suggestions did not work for me? Can you help me please?
相关问题
- React Native Inline style for multiple Text in sin
- Date with SimpleDateFormat in Java
- How Do I Convert Image URI into Byte Expo
- ApolloClient from apollo-boost attemped to assign
- Implementing ssl pinning in a react-native applica
相关文章
- Angular Material Stepper causes mat-formfield to v
- Why doesn't Django enforce my unique_together
- Why do we have to call `.done()` at the end of a p
- Remove expo from react native
- React Native - Dynamic Image Source
- X/Html Validator in PHP
- “Unfortunately, app has stopped” error with buildi
- Using CascadeMode.StopOnFirstFailure on a validato
see source https://facebook.github.io/react-native/docs/textinput.html#keyboardtype
You can use
keyboardType = 'numeric'
for numeric keyboard.In first case punctuation marks are included ex:- . and -
Use regular expression to remove punctuation marks.
Please check snack link
https://snack.expo.io/@vishal7008/1e004c
I grab your problem there is no attribute for Text Input to take numeric only. But I have two method for this, In first method you have to write the code for taking the value numeric this is hack but you can use it, the code is :
For second Method use this:
try use
source