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

Date Picker is inactive when pressing button #872

Open
Linda2734 opened this issue Dec 5, 2024 · 0 comments
Open

Date Picker is inactive when pressing button #872

Linda2734 opened this issue Dec 5, 2024 · 0 comments

Comments

@Linda2734
Copy link

Describe the bug
I'm trying to find a good datepicker library and came across this. After implementing the code example into my app, I recieved teh error, 'new NativeEventEmitter' requires a non-null argument. I fixed this error by changing the version of "react-native-date-picker" to 5.0.1, but now the button does nothing when I press it.

Expected behavior
At first, I tried implementing it to my own app. After that didn't work, I thought it was something wrong with the way it was behaving with the rest of my code. to test the code example, I put the code in a empty file and still received the same behavior. The behavior I was expecting was to be like the example for the modal date picker. I have attached a photo of the expected output

To Reproduce
Add example code that reproduces the behavior.

import React, { useState } from 'react'
import { Button } from 'react-native'
import DatePicker from 'react-native-date-picker'

export default () => {
  const [date, setDate] = useState(new Date())
  const [open, setOpen] = useState(false)

  return (
    <>
      <Button title="Open" onPress={() => setOpen(true)} />
      <DatePicker
        modal
        open={open}
        date={date}
        onConfirm={(date) => {
          setOpen(false)
          setDate(date)
        }}
        onCancel={() => {
          setOpen(false)
        }}
      />
    </>
  )
}

Smartphone (please complete the following information):

  • OS: [iOS]
  • React Native version [0.71.5.]
  • react-native-date-picker version [5.0.1]
    Screenshot 2024-12-05 at 2 27 52 pm
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

No branches or pull requests

1 participant