Latest v2.0.0 issue related to WebView scalesPageToFit and default useWebkit={true} property
See original GitHub issueHello, I have found an issue after upgrade to v2.0.0 that we can’t use “react-native-remote-svg” anymore because of WebView update for scalesPageToFit and default useWebkit={true} property.
Latest “react-native-webview” package used internally in “react-native-remote-svg” uses useWebkit={true} prop as default, and when we scalesPageToFit={true} it shows the warning that we can’t scale svg image to fit when useWebkit is true.
As result we can see a bit broken SVG image, because it is not scaled to fit the WebView. And we can’t pass useWebkit or scalesPageToFit to internal WebView to disable Weblit View on iOS for example.
The best solution is to add scalesPageToFit and useWebkit props to remote svg Image component and pass them to WebView internally. Fo example if we pass:
<Image
useWebkit={false}
scalesPageToFit={true}
source={{ uri: 'data:image/svg+xml;utf8,...' }}
/>
then scaling will work correctly on iOS platform.
I use: react-native: 0.59.1 react: 16.8.3 react-native-remote-svg: 2.0.0
MacOS: 10.14.3 Xcode: 10.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (12 by maintainers)
Top GitHub Comments
v2.0.3 is out now
Hi @seekshiva , I have added incorrect useWebkit prop. Found in docs it should be useWebKit. I created another PR https://github.com/seekshiva/react-native-remote-svg/pull/41.
Please check it and publish new npm packages. Thanks