likashefqet / react-native-image-zoom

A performant and customizable image zoom component built with Reanimated v2+ and TypeScript. 🌃 🚀
https://www.npmjs.com/package/@likashefqet/react-native-image-zoom
MIT License
353 stars 46 forks source link

Zoom not work. #6

Closed AlexCernik closed 2 years ago

AlexCernik commented 2 years ago

Hi, zoom not working on modal component on android.

likashefqet commented 2 years ago

Usage with modals on Android

On Android React Native Gesture Handler does not work by default because modals are not located under React Native Root view in native hierarchy. To fix that, components need to be wrapped with gestureHandlerRootHOC (it's no-op on iOS and web).

Check official statement here

For example:

const ModalContent = gestureHandlerRootHOC(() => (
  <ImageZoom uri={imageUri}  />
);

export default function Example() {
  return (
    <Modal>
      <ModalContent />
    </Modal>
  );
}