expo / snack

Expo Snack lets you run Expo in the browser.
https://snack.expo.dev
MIT License
372 stars 111 forks source link

Snackager is unable to parse index access types #257

Open byCedric opened 2 years ago

byCedric commented 2 years ago

Summary

It looks like Snackager isn't able to parse the newer Indexed Access Types (a replacement for $PropertyOf). This causes issues in at least @react-native-community/datetimepicker v6+

.../@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 | }
...@react-native-community/datetimepicker/src/androidUtils.js: Unexpected token, expected "]" (16:27)

  14 | type Params = {
  15 |   value: Timestamp,
> 16 |   mode: AndroidNativeProps['mode'],
     |                            ^
  17 |   display: AndroidNativeProps['display'],
  18 |   is24Hour: AndroidNativeProps['is24Hour'],
  19 |   minimumDate: AndroidNativeProps['minimumDate'],

What platform(s) does this occur on?

Android, iOS, Web

SDK Version

43

Reproducible demo or steps to reproduce from a blank project

In /snackager

rogerkerse commented 2 years ago

Same problem

ChuckCassadyJR commented 2 years ago

I was having this problem running an iOS build. Rolling back to version 5.1.0 worked for me

npm install @react-native-community/datetimepicker@5.1.0

zaqourioussama commented 2 years ago

I was having this problem running an iOS build. Rolling back to version 5.1.0 worked for me

npm install @react-native-community/datetimepicker@5.1.0

Thanks, that's worked for me