seekshiva / react-native-remote-svg

Adds support for loading svg images in React Native
MIT License
184 stars 71 forks source link

Made fix for webview to support rn using expo #39

Closed musangowope closed 5 years ago

musangowope commented 5 years ago

Background context: Currently working on a RN project using expo. After digging in the code of your package, I saw that SVGImage.js was using WebView from the package. Unfortunately using this component from react-native-webview requires a user to eject their application and do react-native-link. However upon tweaking the code, I discovered that the WebView component exists in the react-native package, which allows you to use your SVGImage in expo

Made fix for webview to support rn using expo. removed react-native-webview from package json. Webview component is now included react native so no need to have extra package. SvgImage: removed import for react-native-webview and used WebView component from react-native package

seekshiva commented 5 years ago

Thanks for the PR. Please check #35 . As of React Native 0.58, WebView has been decoupled and is now published from react-native-webview.

The latest version of expo v32.0.0 depends on react-native 0.57, and that is why you still see WebView available inside react-native project. I recommend you use v1.x version of this project when you are using expo v32.0.0

When the next version of expo is out, it will depend on newer version of expo that doesn't have WebView in it. When you update to that version, expo will allow importing from react-native-webview directly without using any link command. At that point, v2.x of this project will work out.

So my recommendation for you: