🚧 Fix - Resolve app crash on missing function#3
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the react-native-photo-view library to maintain compatibility with React Native 0.79, where the resolveAssetSource function can no longer be imported directly from the internal React Native path. Instead, it must be accessed through the Image component as Image.resolveAssetSource. This is a breaking change fix that prevents app crashes when using the library with React Native 0.79.
Changes:
- Updated version from 1.6.0 to 1.7.0 in both package.json and package-lock.json
- Migrated from
require('react-native/Libraries/Image/resolveAssetSource')toImage.resolveAssetSourceAPI - Applied changes consistently to both iOS and Android implementations
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Version bumped from 1.6.0 to 1.7.0 |
| package-lock.json | Version bumped from 1.5.3 to 1.7.0 |
| PhotoView.ios.js | Updated import to include Image, removed direct resolveAssetSource require, and updated resolveAssetSource calls to use Image.resolveAssetSource |
| PhotoView.android.js | Updated import to include Image, removed direct resolveAssetSource require, and updated resolveAssetSource calls to use Image.resolveAssetSource |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AndrewFinlay
left a comment
There was a problem hiding this comment.
Looks pretty straight forward, but looking at the original lib it looks old and unmaintained. With that in mind we should really be moving off react-native-photo-view soon. Do you know if there's any other options?
Agree. I didn’t come across any straightforward replacements for this library that are well maintained, but we should be able to implement a custom solution using existing dependencies. I’ll create a separate task for it so we can look into that. |
Created tech debt task: |
This update DOES NOT INCLUDE native updates
Description
This PR includes a fix where with React Native 0.79, it can no longer be imported separately. Instead it is now referenced via the
Imagecomponent.