likashefqet/react-native-image-zoom

Zoom not work.

AlexCernik opened this issue · 1 comments

Hi, zoom not working on modal component on android.

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>
  );
}