react-native-date-picker
react-native-date-picker copied to clipboard
[android][new_arch][fix]: pass timestamp string instead of iso string…
A workaround for runtime error with new architecture enabled on Android https://github.com/henninghall/react-native-date-picker/issues/840
Please provide example code where this issue is reproducible and I'll look into it
This solution helped me to fix crashes on Android with the new architecture. Can it be integrated in the next release?
@henninghall this PR those indeed fix the crash that occur on Android on the new arch should also be tested on a non-new arch app to see if its brake anything.
@henninghall A working exemple in my app :
import DatePicker from "react-native-date-picker";
const Select = () => {
const [date, setDate] = useState(new Date());
return <DatePicker date={date} onDateChange={setDate} />;
};
@henninghall can you please explain little bit more on how to use your solution
@henninghall
"react-native-date-picker": "5.0.8" "expo": "52.0.11"
if we set DatePicker prop modal to false it will error on android like this:
example code:
<DatePicker
modal={false}
mode="datetime"
open={open}
date={new Date("2025-01-01")}
onConfirm={(date) => {
setOpen(false);
setDate(date);
}}
onDateChange={(date) => {
console.log("date: ", date);
setDate(date);
}}
onCancel={() => {
setOpen(false);
}}
/>
this solution proved.
it's work:
i am still having this issue using "react-native-date-picker": "git+https://github.com/badrey/react-native-date-picker.git#new-arc-fix". exact same error on Android please help. !