Why modal and other image-viewer packages not compitable with WEB ???
To see the example in example folder.
Install it from npm yarn add react-native-image-viewer-web
or just copy & paste ImgViewer.js
and Modal.js
to the same folder.
import ImgViewer from 'react-native-image-viewer-web';
Or you can import it from the pasted file: import ImgViewer from './ImgViewer';
import React from 'react';
import ImgViewer from 'react-native-image-viewer-web';
export default function App() {
console.log()
return (
<ImgViewer imgs={[
require('./assets/icon.png'),
'https://avatars3.githubusercontent.com/u/20993661?s=460&v=4']
} />
);
}
- imgs:
[require('./assets/icon.png'), 'https://avatars3.githubusercontent.com/u/20993661?s=460&v=4']
, It can be both static file required & remote url(must start with http or https). - threshold:
num
. How many pixels(default 200) will be the threshold that determines changing image to happen. - footer:
num
. Should the footer show or not(default). - bgColor:
black
by default. - footerColor:
white
by default. - footerTextColor:
black
by default.
import {Modal} from 'react-native-image-viewer-web'
You want not? OK.
That's all, good luck.