Reputation: 256
Im trying to use react-native-webview but it wont load up, it just show white blank screen. I have found multiple sources that it could happen if I use older version of expo, so I updated it to the newest one but problem still occurs.
theese are the versions that Im using from package.json:
"dependencies": {
"expo": "~40.0.0",
"expo-status-bar": "~1.0.3",
"express": "^4.15.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-orientation": "^3.1.3",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.13.12",
"react-native-webview": "^11.2.4",
"react-navigation": "^4.3.6",
"react-navigation-stack": "^2.3.10",
"socket.io": "^2.3.0",
"socket.io-client": "^2.3.0"
}
if I try to load my app it loads but it wont show webview it shows just blank white screen and I get this warning.
I have tried to downgrade webview to version 11.0.0. rewriting package.json and npm install to create new node_modules but when I did that I got bunch of errors
any recommendations please how can I fix this ? Im trying just simple webview from working example. I have downloaded react-native-webview and linked it
Upvotes: 1
Views: 1745
Reputation: 256
FINALLY I have solved my problem with webview, it took me around 7 days, I have tried everything possible and the reason was?...Styling, I was trying multiple styling parameters but never combination of height, width + overflow. The overflow is the reason it didnt work. So if you have problem with webview being only white blank screen try this: style={{ height: 150, width: 680,overflow:'hidden' }} ofcourse height/width you can change how you want but it should 100% work.
Upvotes: 4