react-native-stateless-form icon indicating copy to clipboard operation
react-native-stateless-form copied to clipboard

How to handle numbers?

Open ms88privat opened this issue 8 years ago • 1 comments

I have a really hard time figuring out how to handle numbers best.

There are two main problems here:

  1. My initialValue is an integer, which will not get displayed by the react-native TextInput
  2. validatorjs only validates strings

I don't really want to translate all my number props of my models to strings beforehand. Afterwards I can't really intercept the value because it will get handled by redux-form. Any idea here?

edit: The documentation of redux-form says, that value will be either a bool or a string, which is not the case by me... hm

ms88privat avatar May 12 '16 16:05 ms88privat

To get around this, I edited the InlineTextInput Widget here and here

and did another isNumber check in the validate-model plugin

ms88privat avatar May 12 '16 16:05 ms88privat