https://github.com/gamote/expo-babel-void-optional-chain-issue
https://github.com/gamote/expo-babel-void-optional-chain-issue
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gamote/expo-babel-void-optional-chain-issue
- Owner: Gamote
- Created: 2024-01-05T16:50:26.000Z (over 2 years ago)
- Default Branch: sdk-50
- Last Pushed: 2024-01-05T18:00:20.000Z (over 2 years ago)
- Last Synced: 2024-12-29T07:42:41.302Z (over 1 year ago)
- Language: TypeScript
- Size: 424 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
It seems that `void someFunction?.()` skips the function call in production builds.
I have checked the transpiled code using the debugger and `void someFunction?.()` is transpiled to `undefined` in production builds.
If we do `someFunction?.()` or `void someFunction()` it will work just fine.
### Additional information
- I have tested this on iOS and Android
- I have tested this on SDK 49 and it works as expected
- When starting with `expo start` it works as expected
## Reproduce the issue
1. Clone the repo
2. (optional) Run `nvm use`
3. Run `yarn`
4. Start the app `yarn ios --no-dev` or `yarn android --no-dev`
## Expected behaviour
Three alerts should be shown, one after the other.
## Actual behaviour
Only two alerts are shown.