react-native-image-viewing
react-native-image-viewing copied to clipboard
react-native-web support
Would be nice. Right now I'm getting this error because it's missing a web implementation for ImageItem
ERROR in ./node_modules/react-native-image-viewing/dist/ImageViewing.js
Module not found: Error: Can't resolve './components/ImageItem/ImageItem' in '/home/me/prj/ssb/manyverse/node_modules/react-native-image-viewing/dist'
@ ./node_modules/react-native-image-viewing/dist/ImageViewing.js 1:1047-1090
@ ./node_modules/react-native-image-viewing/dist/index.js
@ ./lib/frontend/components/ZoomableImage.js
@ ./lib/frontend/components/Markdown.js
@ ./lib/frontend/components/messages/AboutMessage.js
@ ./lib/frontend/components/messages/Message.js
@ ./lib/frontend/components/FullThread.js
@ ./lib/frontend/screens/thread/view.js
@ ./lib/desktop/index.js
I got the same problem on web
/Users/X/XX/XXX/node_modules/react-native-image-viewing/dist/ImageViewing.js
Module not found: Can't resolve './components/ImageItem/ImageItem' in '/Users/X/XX/XXX/node_modules/react-native-image-viewing/dist'
Please help!
Just to check if supporting react-native-web is easy, I did the following changes:
- Renamed
node_modules/react-native-image-viewing/dist/components/ImageItem/ImageItem.android.jstoImageItem.js - In
node_modules/react-native-image-viewing/dist/hooks/useImageDimensions.jsI changedImage.getSizeWithHeaders(source.uri, source.headers,toImage.getSize(source.uri,
And it worked! In other words, supporting react-native-web in this repo is not too hard. I can make a PR, but wanted to inform about this already.