Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

Expo SDK 37: upgrading to react-native-webview@8.1.1 broke onShouldStartLoadWithRequest functionality for undefined deeplinks

$
0
0

My original code was working before upgrading to Expo SDK 37 and react-native-webview@8.1.1:

const onShouldStartLoadWithRequest = ({ url }: WebViewNavigation): boolean => {    const response = parseResponse(url);    if (shouldProceed(response)) {        proceed(response);        return false;    }    return response;};parseResponse(url: string): Params | boolean {    const uri = URL.parse(url);    if (uri.protocol === "deeplinkprotocol:") {        const query = queryString.parse(uri.search, { decode: false });        switch (uri.host) {        case Event.connected:            return {                param: query.param,            };        default:            return false;        }    }    return uri.protocol === this.http || uri.protocol === this.https;}

The redirection to the request url stopped working since onShouldStartLoadWithRequest threw an error.


Viewing all articles
Browse latest Browse all 6212

Trending Articles