@@ -278,18 +278,13 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
278278 } ;
279279
280280 onShouldStartLoadWithRequestCallback = (
281- shouldStart : boolean ,
282- _ : string ,
283- lockIdentifier : number ,
284- ) => {
285- NativeModules . RNCWebView . onShouldStartLoadWithRequestCallback ( shouldStart , lockIdentifier ) ;
286- } ;
287-
288- legacyOnShouldStartLoadWithRequestCallback = (
289281 shouldStart : boolean ,
290282 url : string ,
283+ lockIdentifier ?: number ,
291284 ) => {
292- if ( shouldStart ) {
285+ if ( lockIdentifier ) {
286+ NativeModules . RNCWebView . onShouldStartLoadWithRequestCallback ( shouldStart , lockIdentifier ) ;
287+ } else if ( shouldStart ) {
293288 UIManager . dispatchViewManagerCommand (
294289 this . getWebViewHandle ( ) ,
295290 this . getCommands ( ) . loadUrl ,
@@ -353,13 +348,6 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
353348 onShouldStartLoadWithRequestProp ,
354349 ) ;
355350
356- const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest (
357- this . legacyOnShouldStartLoadWithRequestCallback ,
358- // casting cause it's in the default props
359- originWhitelist as readonly string [ ] ,
360- onShouldStartLoadWithRequestProp ,
361- ) ;
362-
363351 const webView = (
364352 < NativeWebView
365353 key = "webViewKey"
@@ -373,7 +361,7 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
373361 onHttpError = { this . onHttpError }
374362 onRenderProcessGone = { this . onRenderProcessGone }
375363 onMessage = { this . onMessage }
376- onShouldStartLoadWithRequest = { onShouldStartLoadWithRequest }
364+ onShouldStartLoadWithRequest = { this . onShouldStartLoadWithRequest }
377365 ref = { this . webViewRef }
378366 // TODO: find a better way to type this.
379367 source = { resolveAssetSource ( source as ImageSourcePropType ) }
0 commit comments