Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android][new_arch][fix]: pass timestamp string instead of iso string… #848

Closed
wants to merge 1 commit into from

Conversation

badrey
Copy link

@badrey badrey commented Aug 14, 2024

A workaround for runtime error with new architecture enabled on Android #840

… to date props to fix runtime error on new architecture on android
@henninghall
Copy link
Owner

Please provide example code where this issue is reproducible and I'll look into it

@RamProg
Copy link

RamProg commented Nov 13, 2024

This solution helped me to fix crashes on Android with the new architecture. Can it be integrated in the next release?

@mateoabrbt
Copy link

@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.

@NonozgYtb
Copy link

@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} />;
};

@rak-dev
Copy link

rak-dev commented Jan 20, 2025

@henninghall can you please explain little bit more on how to use your solution

@tarzui
Copy link

tarzui commented Jan 21, 2025

@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:
Screenshot 2568-01-21 at 19 49 58

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:
Screenshot 2568-01-21 at 19 53 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants