Hi 馃憢
I'm trying to make this package work with web. I checked the issues, an old one here mentioned that this package isn't compatible with web: #42
I actually believe it's 99% compatible with web. I use this package with an expo app, on web. I'm getting an error, but it still works.
The error is basically saying e.nativeEvent.source isn't valid on web.
By quickly commenting a few lines of node_modules/react-native-awesome-gallery/lib/module/index.js, I got rid of the error:
const defaultRenderImage = ({
item,
setImageDimensions
}) => {
return /*#__PURE__*/React.createElement(Image, {
onLoad: e => {
// const {
// height: h,
// width: w
// } = e.nativeEvent.source;
const h = 800;
const w = 500;
setImageDimensions({
height: h,
width: w
});
},
source: {
uri: item
},
resizeMode: "contain",
style: StyleSheet.absoluteFillObject
});
};
it's rough, it's just to prove that we could make this package work with web without too much trouble.
I think this line needs to be changed:
|
const { height: h, width: w } = e.nativeEvent.source; |
It's responsible for getting the size of the image being clicked. If I get around to it I'll make a PR, but I thought I'd just let people know.
Hi 馃憢
I'm trying to make this package work with web. I checked the issues, an old one here mentioned that this package isn't compatible with web: #42
I actually believe it's 99% compatible with web. I use this package with an expo app, on web. I'm getting an error, but it still works.
The error is basically saying
e.nativeEvent.sourceisn't valid on web.By quickly commenting a few lines of
node_modules/react-native-awesome-gallery/lib/module/index.js, I got rid of the error:it's rough, it's just to prove that we could make this package work with web without too much trouble.
I think this line needs to be changed:
react-native-awesome-gallery/src/index.tsx
Line 80 in 5ab264d
It's responsible for getting the size of the image being clicked. If I get around to it I'll make a PR, but I thought I'd just let people know.