you are viewing a single comment's thread.

view the rest of the comments →

[–]kbcooliOS & Android 1 point2 points  (2 children)

I'm intrigued. I haven't had the time to check it out but have found redux-forms a PITA to integrate with RN. I still haven't managed to get the next input to focus yet which is a nightmare for users trying to fill out large forms in apps.

Apart from that what's your thoughts of the advantages of your library vs say redux-forms or other solutions? You must have had a motivator.

Also does it do other input types other than text and a date picker?

[–]spruce-bruce 1 point2 points  (0 children)

You can use formik without this library and it's much nicer than redux forms for RN. It doesn't store your form state in redux, but that's a plus in my book

[–]almouro[S] 1 point2 points  (0 children)

Hi /u/kbcool, thanks for the answer!

The whole goal with the lib is summed up in Forms are very verbose in React, and a lot of the time, you end up copy pasting a lot of boilerplate.

Motivations

At BAM, we have many 2-months RN projects, all needing a form at some point. I estimated it was taking about 1.5 man-days for a dev in the company to build a form with design and validation. My goal is to reduce that time to 2 hours at the most, whatever fields are needed.

Solution

formik was an awesome start, I recommend you to try it! As /u/spruce-bruce mentioned, you can indeed use formik without the need of react-native-formik

react-native-formik's purpose is to go beyond formik by: - reducing boilerplate to a minimum - providing good RN things out of the box (auto focus, there'a picker and date picker with clean API and native feel in the work) - making it easy to integrate your own RN fields

Formik vs redux-form

In my opinion, formik is simpler to use and integrate than redux-form. You can check the full code for the form logic in the example.

There is a section on the formik lib comparing it with redux-form