expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
34k stars 5.44k forks source link

expo-camera/next onResponsiveOrientationChanged event type mismatch #28429

Open Landro3 opened 6 months ago

Landro3 commented 6 months ago

Minimal reproducible example

https://github.com/Landro3/expo-camera-orientation

What platform(s) does this occur on?

iOS

Did you reproduce this issue in a development build?

Yes

Summary

The event object from onResponsiveOrientationChanged has a type definition to be one of four strings, shown below. However, the event.orientation value is actually a number instead of one of the strings in its type definition.

image

Environment

expo-env-info 1.2.0 environment info: System: OS: macOS 14.4.1 Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - ~/.volta/tools/image/node/20.11.1/bin/node Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn npm: 10.2.4 - ~/.volta/tools/image/node/20.11.1/bin/npm Watchman: 2023.11.13.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4 IDEs: Xcode: 15.3/15E204a - /usr/bin/xcodebuild npmPackages: expo: ~50.0.14 => 50.0.17 react: 18.2.0 => 18.2.0 react-native: 0.73.6 => 0.73.6 Expo Workflow: managed

Expo Doctor Diagnostics

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check for issues with metro config ✔ Check npm/ yarn versions ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that native modules do not use incompatible support packages ✔ Check for legacy global CLI installed locally ✔ Check that native modules use compatible support package versions for installed Expo SDK ✔ Check that packages match versions required by installed Expo SDK

Didn't find any issues with the project!

expo-bot commented 6 months ago

Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

alanjhughes commented 6 months ago

Hi @Landro3 - I've pulled your repro and this is what I am seeing. Where are you seeing a number?

Screenshot 2024-04-24 at 21 42 04
alanjhughes commented 6 months ago

@Landro3 - Are you referring to the target property that is also returned?

Landro3 commented 6 months ago

interesting, so this is the block of code that has the log statement in it

<CameraView
  style={{ flex: 1, borderWidth: 1 }}
  responsiveOrientationWhenOrientationLocked
  onResponsiveOrientationChanged={(e) => {
    console.log(e.orientation);
  }}
/>

i'm using an iPhone 13 Pro connected to my expo server running npm run ios and these are the logs i'm seeing from the app when i rotate the phone

image
alanjhughes commented 6 months ago

@Landro3 - very strange, I'm also using a 13 pro 🤔 what version of iOS?

Landro3 commented 6 months ago

my phone's on 17.4.1