MIGRATED: The use of postMessage will lead to WebView onLoadStart run Twice (#16547) #9
Labels
in progress
A pull request is in progress to fix this issue
migrated
Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+
Type: bug report
Migrated from facebook/react-native#16547.
@TrustTheBoy says:
Environment
OS: macOS Sierra 10.12.6
Node: v7.10.0
Yarn: 0.27.5
npm: 4.2.0
Watchman: 4.7.0
Xcode: Xcode Version 9.1 beta (9B37)
Android Studio: 2.3
react-native: 0.48.4
react: 16.0.0-alpha.12
Target Platform: iOS (8-11.1) android(4.4.4-8.0)
Steps to Reproduce
messtest = e => {
const message = e.nativeEvent.data
alert(message)
}
<WebView
ref={w => this.webview = w}
source={{uri:jumpUrl}}
onMessage={this.messtest}
domStorageEnabled={true}
javaScriptEnabled={true}
startInLoadingState={true}
dataDetectorTypes="none"
onLoadEnd={()=>{
console.log('load end... onLoadEnd function');
}}
onLoadStart={()=>{
console.log('load start..');
}}
renderLoading={this._renderLoading}
//onNavigationStateChange={this.onNavigationStateChange}
/>
Expected Behavior
LoadStart should be executed before loadEnd,As you can see from the diagram, load end... re executes load start, and then does not execute load end, which causes the state to be updated. It has always been load start
More info in original issue thread
The text was updated successfully, but these errors were encountered: