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

TypeError: undefined is not an object (evaluating '_picker.default[mode].dismiss') #873

Open
nandkishorakangire opened this issue Mar 21, 2024 · 1 comment

Comments

@nandkishorakangire
Copy link

nandkishorakangire commented Mar 21, 2024

Bug report

Summary

TypeError: undefined is not an object (evaluating '_picker.default[mode].dismiss')
in RNDateTimePickerAndroid (created by DateTimePicker)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer (created by Modal)
in RCTView (created by View)
in View (created by Modal)
in VirtualizedListContextResetter (created by Modal)
in RCTModalHostView (created by Modal)
in Modal (created by DateTimePicker)
in DateTimePicker (created by Input)

Reproducible sample code

import { Modal } from "react-native";
import React, { useState } from "react";
import DateTime from "@react-native-community/datetimepicker";

const DateTimePicker = () => {
  const [show, setShow] = useState(true);
  return (
    <>
      {show ? (
        <Modal transparent visible={show}>
          <DateTime
            testID="dateTimePicker"
            value={new Date()}
            mode="datetime"
            is24Hour={true}
          />
        </Modal>
      ) : (
        <></>
      )}
    </>
  );
};

export default DateTimePicker;

Steps to reproduce

  1. Just run this code and you'll get stuck. after sometime you'll see the thrown error in terminal

Describe what you expected to happen:

  1. Internal Package Error should be fixed

Environment info

npx react-native info output:

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Memory: 5.14 GB / 15.84 GB
Binaries:
Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10406996
Visual Studio: 17.8.34316.72 (Visual Studio Community 2022)
Languages:
Java: 16.0.2
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

# paste it here
 ERROR  Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

TypeError: undefined is not an object (evaluating '_picker.default[mode].dismiss')
    in RNDateTimePickerAndroid (created by DateTimePicker)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer (created by Modal)
    in RCTView (created by View)
    in View (created by Modal)
    in VirtualizedListContextResetter (created by Modal)
    in RCTModalHostView (created by Modal)
    in Modal (created by DateTimePicker)
    in DateTimePicker (created by Input)
image

datetimepicker version: 6.5.2

Android version: 13.x

@RezaPN
Copy link

RezaPN commented Jun 8, 2024

Bug report

Summary

TypeError: undefined is not an object (evaluating '_picker.default[mode].dismiss') in RNDateTimePickerAndroid (created by DateTimePicker) in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer (created by Modal) in RCTView (created by View) in View (created by Modal) in VirtualizedListContextResetter (created by Modal) in RCTModalHostView (created by Modal) in Modal (created by DateTimePicker) in DateTimePicker (created by Input)

Reproducible sample code

import { Modal } from "react-native";
import React, { useState } from "react";
import DateTime from "@react-native-community/datetimepicker";

const DateTimePicker = () => {
  const [show, setShow] = useState(true);
  return (
    <>
      {show ? (
        <Modal transparent visible={show}>
          <DateTime
            testID="dateTimePicker"
            value={new Date()}
            mode="datetime"
            is24Hour={true}
          />
        </Modal>
      ) : (
        <></>
      )}
    </>
  );
};

export default DateTimePicker;

Steps to reproduce

  1. Just run this code and you'll get stuck. after sometime you'll see the thrown error in terminal

Describe what you expected to happen:

  1. Internal Package Error should be fixed

Environment info

npx react-native info output:

info Fetching system and libraries information... System: OS: Windows 10 10.0.22621 CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz Memory: 5.14 GB / 15.84 GB Binaries: Node: 18.17.0 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-223.8836.35.2231.10406996 Visual Studio: 17.8.34316.72 (Visual Studio Community 2022) Languages: Java: 16.0.2 npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.8 => 0.70.8 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

# paste it here
 ERROR  Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

TypeError: undefined is not an object (evaluating '_picker.default[mode].dismiss')
    in RNDateTimePickerAndroid (created by DateTimePicker)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer (created by Modal)
    in RCTView (created by View)
    in View (created by Modal)
    in VirtualizedListContextResetter (created by Modal)
    in RCTModalHostView (created by Modal)
    in Modal (created by DateTimePicker)
    in DateTimePicker (created by Input)
image datetimepicker version: 6.5.2

Android version: 13.x

This error is caused by using "datetime" in mode props on an Android device, as "datetime" is only for iOS.

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

2 participants