Why don't WebView.onLoadStart and onLoadEnd get called in React Native?

I tried using an element like this:

<WebView source={{ uri: contentURL }} startInLoadingState={true} style={styles.articleOnWeb.webView}> onLoadStart={function () { ToastAndroid.show("onLoadStart", ToastAndroid.SHORT) console.log("onLoadStart") const nextState = Immutable.Map(thisComponent.state).toJS() nextState.articleOnWebLoadingProgress = 0.5 thisComponent.setState(nextState) }} onLoadEnd={function () { ToastAndroid.show("onLoadEnd", ToastAndroid.SHORT) console.log("onLoadEnd") const nextState = Immutable.Map(thisComponent.state).toJS() nextState.articleOnWebLoadingProgress = 1 thisComponent.setState(nextState) setTimeout(()=> { const nextState = Immutable.Map(thisComponent.state).toJS() nextState.articleOnWebIsLoaded = true thisComponent.setState(nextState) }, 1000) }} </WebView> 
+5
source share

Source: https://habr.com/ru/post/1263951/


All Articles