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

IOS and ANDROID onChange Event do not share the same value but have the same type #927

Open
Valetek opened this issue Aug 31, 2024 · 0 comments

Comments

@Valetek
Copy link

Valetek commented Aug 31, 2024

Bug report

Summary

DatePicker onChange value is not the same between IOS and ANDROID but both actually share the same type, leading to TS invalid type when trying to accessing "unexisting" property

Reproducible sample code

		<DateTimePicker
			value={birthdate}
			is24Hour={true}
			onChange={(
			        value: DateTimePickerEvent & {
				nativeEvent: { target?: number };
			}) => {
				if (value.nativeEvent.target) {
					// operation on date change
			}}
		/>

Steps to reproduce

Set a DatePicker component anywhere with anydata and run it on IOS, this was tested with mode "compact"

Describe what you expected to happen:

IOS onChange type should be following the actual data returned

Environment info

EXPO SDK 51.0

System:
  OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
  Memory: 1.64 GB / 4.81 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 20.5.1
    path: /usr/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/bin/yarn
  npm:
    version: 10.8.2
    path: /usr/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

datetimepicker version: 2.7.5

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