HosseinShabani / react-native-modern-datepicker

A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale)
MIT License
578 stars 164 forks source link

using with formik #18

Open RZsam opened 4 years ago

RZsam commented 4 years ago

when using datepicker inside Formik days are not shown:

image

when datepicker moved outside of <Formik> everything work just fine.

"react-native-modern-datepicker": "^1.0.0-beta.7", "formik": "^2.1.2",

         <Formik
                initialValues={{}}
                onSubmit={onSubmit}
            >
                {({handleSubmit}) =>
                    <ScrollView
                        contentContainerStyle={styles.content}
                        showsVerticalScrollIndicator={false}
                    >

                        <DatePicker
                            name='date'
                            mode='monthYear'
                        />
                        <Button
                            style={styles.saveBtn}
                            onPress={handleSubmit}
                        >
                            <Text bold style={styles.saveBtnText}>
                                بارگذاری
                            </Text>
                        </Button>
                    </ScrollView>
                }
            </Formik>
RZsam commented 4 years ago

sorry for closing but it's not working all the times