Anyone have any success using this input spinner with Formik? #65
Unanswered
KitchiHerbst
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having trouble using this input spinner with Formik in React Native. I've narrowed the issue down to the onChange function of the input spinner but nothing I'm trying is working.
Edit: I fixed it, incase anyone also is having this problem the solution is below.
The fix is pretty simple, I was first trying to just pass formiks handleChange prop directly to the onChange of the Input spinner but you need to give it the setFieldProp like so:
<InputSpinner
skin="clean"
background={colors.primary}
min={0}
type="float"
name="weight"
value={values.weight}
initialValue={values.weight}
onChange={(num) => {
setFieldValue("weight", num)
setFieldTouched('weight', true, false)
}}
/>
Beta Was this translation helpful? Give feedback.
All reactions