gusparis / react-native-month-year-picker

React Native Month Picker component for iOS & Android
MIT License
106 stars 74 forks source link

App crashes while opening react native month year picker #27

Closed choudhary1200 closed 3 years ago

choudhary1200 commented 4 years ago

App is crashing when opening picker Using: "react-native": "0.62.2" "react-native-month-year-picker": "^1.3.2",

Code: import React, { useState, useCallback } from 'react'; import { View, SafeAreaView, Text,TouchableOpacity } from 'react-native'; import MonthPicker from 'react-native-month-year-picker';

const App = () => { const [date, setDate] = useState(new Date()); const [show, setShow] = useState(false);

const showPicker = useCallback((value) => setShow(value), []);

const onValueChange = useCallback( (event, newDate) => { const selectedDate = newDate || date;

  showPicker(false);
  setDate(selectedDate);
},
[date, showPicker],

);

return (

Month Year Picker Example {/* {moment(date, "MM-YYYY")} */} showPicker(true)}> OPEN {show && ( )}

); };

export default App;

Tried following steps but not working react-native run-android npm start --reset-cache

gusparis commented 4 years ago

@choudhary1200 The code you shared is working. Do you happen to have the error log?

edit: why is the Month Year Picker Example not either commented nor wrapped by a <Text>? 🤔

choudhary1200 commented 4 years ago

@choudhary1200 The code you shared is working. Do you happen to have the error log?

edit: why is the Month Year Picker Example not either commented nor wrapped by a <Text>?

I am getting below native error Didn't find class "java.time.instant" See below attached screenshot for more details.

Device Info: Android 7 minSdkVersion 19

Screenshot_2020-08-08-14-27-54

gusparis commented 4 years ago

@choudhary1200 your Android version is lower than 8.0. That's why the class is missing.

gusparis commented 4 years ago

Let me see if I can introduce a lower version workaround

gusparis commented 3 years ago

:tada: This issue has been resolved in version 1.3.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: