Skip to content

error: SyntaxError DateTimePickerAndroid.js #603

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

Closed
putuoka opened this issue Apr 25, 2022 · 7 comments
Closed

error: SyntaxError DateTimePickerAndroid.js #603

putuoka opened this issue Apr 25, 2022 · 7 comments

Comments

@putuoka
Copy link

putuoka commented Apr 25, 2022

error: SyntaxError: D:\user\app\node_modules@react-native-community\datetimepicker\src\DateTimePickerAndroid.js: Unexpected token, expected "]" (97:42)

95 | }
96 |

97 | function dismiss(mode: AndroidNativeProps['mode']) {
| ^
98 | // $FlowFixMe - AbstractComponent [1] is not an instance type.
99 | pickers[mode].dismiss();
100 | }

version:
"@react-native-community/datetimepicker": "^6.1.2",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native": "0.63.4",

Android version: emulator nexus 10 tablet

@ahardy42
Copy link

I'm seeing this on iOS for some reason

@ahardy42
Copy link

ahardy42 commented Apr 27, 2022

might need to update flow in your project?? #574 (comment)

@dspinellis
Copy link

A possible workaround is to install an earlier version, e.g. with yarn add @react-native-community/datetimepicker@npm:3.5.2.

@buschco
Copy link

buschco commented May 30, 2022

You can use patch-package to manual replace the PropertyTypes:

AndroidNativeProps['mode'] -> $PropertyType<AndroidNativeProps, 'mode'>

@waqaramjad
Copy link

same issue here

@GarciaaMarilia
Copy link

A possible workaround is to install an earlier version, e.g. with yarn add @react-native-community/datetimepicker@npm:3.5.2.

this works for me

@vonovak
Copy link
Member

vonovak commented Jul 7, 2022

hello, I'm closing this as resolved - you can use one of the aforementioned workarounds or upgrade react native to >= 0.66

thank you!

@vonovak vonovak closed this as completed Jul 7, 2022
@vonovak vonovak pinned this issue Jul 7, 2022
@vonovak vonovak unpinned this issue Jul 7, 2022
@react-native-datetimepicker react-native-datetimepicker locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants