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

fix: Update isReactNative check to consider Expo as well #11555

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

jimblanc
Copy link
Contributor

@jimblanc jimblanc commented Jun 28, 2023

Description of changes

This change fixes a recently introduced regression to the Platform.isReactNative utility. Previously this utility would evaluate to to true for both React Native & Expo, but after a recent refactor it only returns true for React Native.

Currently this utility is only used in one place: https://github.com/aws-amplify/amplify-js/blob/main/packages/storage/src/providers/axios-http-handler.ts#L181-L183

Storage's Axios HTTP handler uses a special request transformer on React Native to correctly detect file blobs (vs a normal JS object). When Platform.isReactNative stopped evaluating to true for Expo, this functionality broke.

Issue #, if available

Description of how you validated changes

Tested locally in an Expo app by uploading an image in S3.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

jimblanc and others added 2 commits June 28, 2023 15:58

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@jimblanc jimblanc marked this pull request as ready for review June 28, 2023 21:11
@jimblanc jimblanc requested review from a team as code owners June 28, 2023 21:11
@jimblanc jimblanc merged commit 60f7d3d into aws-amplify:main Jun 28, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants