I like the approach used by [`react-medium-image-zoom`](https://github.com/rpearce/react-medium-image-zoom#custom-zoom-modal-content) where it uses the [`dialog`](https://caniuse.com/dialog) html element. ## Implementation This is the code that `react-medium-image-zoom` uses: 