[WebView] in >= 0.7 crashes if wraps by another component
See original GitHub issueIf WebView component in version 0.7 and above, wraps by another custom component, after couple of refreshes, crashes the react-native.
Here’s the code the sample code which causes crash after refresh the view couple of times.
'use strict';
var React = require('react-native');
var {
AppRegistry,
View,
WebView,
Component
} = React;
class CustomWebView extends Component {
reload() {
this.refs.internalWebView.reload();
}
render() {
return (
<WebView ref="internalWebView" {...this.props}/>
);
}
}
var Sample1 = React.createClass({
componentDidMount() {
this.refs.AWESOME.reload();
},
render: function() {
var url = "http://google.com";
return (
<CustomWebView ref="AWESOME" url={url}/>
);
}
});
AppRegistry.registerComponent('Sample1', () => Sample1);
Here’s the error code
RCTWebViewManager.m:78
2015-07-15 15:29:12.885 Sample1[32006:13476976] ***
Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Invalid view returned from registry, expecting RKWebView, got: (null)'
So it seems that viewRegistry
contains only RCTRootContentView
and React.findNodeHandle(this.refs[RCT_WEBVIEW_REF])
returns a handler that doesn’t exists in viewRegistry
.
** btw, It works perfectly fine on 0.6 **
Any thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (1 by maintainers)
Top Results From Across the Web
Android is crashing when "WebView" is wrapped by "View" #811
Using androidLayerType="software" solves the problem, but performance becomes horrible this way. Another workaround is to unmount the webview ...
Read more >Here's how to fix those mysterious Android WebView crashes
Tap the three-dot menu at the top right of this screen, then select "Uninstall updates." This won't uninstall Android System WebView completely— ...
Read more >WebView crashes on navigation popBackStack() with Jetpack ...
I have WebView inside the LazyColumn. It shows up fine. The thing is when I try to navigate back by calling navController.
Read more >Secure Integration of Web Content and Applications on ...
The WebView class in Android and UIWebView/WKWebView class in iOS are UI widgets that display remote web ele- ments or entire web pages...
Read more >BC3 change log - Scooter Software
Fixed crash when using "Up One Level on Both Sides" and the current base folders are filtered out in the parent comparison. -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi there! This issue is being closed because it has been inactive for a while.
But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/webview-in-07-crashes-if-wraps-by-another-component
ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub.
Also, if this issue is a bug, please consider sending a PR with a fix. We’re a small team and rely on the community for bug fixes of issues that don’t affect fb apps.
I am getting the same issues when loading/unloading instances of the webview inside a ScrollView component.