Snack only works on Android since updating to SDK 33

Ever since upgrading my Snack to SDK 33, it now only works on Android. The iOS app seems to load but shows nothing. I can confirm that this is not a problem with the external library I am using. Here’s the Snack:


Here’s the code:

/*Example of Recat Native Loading Spinner Overlay*/
import * as React from 'react';
import { Text, View, StyleSheet, Button, WebView } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';

export default class App extends React.Component {
  state = {
    //default loading false
    loading: false,
  };

  showSpinner() {
    console.log('Show Spinner');
    this.setState({ loading: true });
  }

  hideSpinner() {
    console.log('Hide Spinner');
    this.setState({ loading: false });
  }

  render() {
    return (
      <View style={styles.container}>
        <Spinner
          //visibility of Overlay Loading Spinner
          visible={this.state.loading}
          //Text with the Spinner
          textContent={'Loading...'}
          //Text style of the Spinner Text
          textStyle={styles.spinnerTextStyle}
        />

        <WebView
          style={styles.WebViewStyle}
          //Loading URL
          source={{ uri: 'https://google.com' }}
          //Enable Javascript support
          javaScriptEnabled={true}
          //For the Cache
          domStorageEnabled={true}
          //View to show while loading the webpage
          //Want to show the view or not
          //startInLoadingState={true}
          onLoadStart={() => this.showSpinner()}
          onLoadEnd={() => this.hideSpinner()}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    textAlign: 'center',
    paddingTop: 20,
  },
  spinnerTextStyle: {
    color: '#FFF',
  },
});

All help would be appreciated :slightly_smiling_face:

Hey @sunnyb,

I just tested this and it seems to work for me.

Huh, that’s weird. I’ve created a new snack on another account, deleted the Expo app and reinstalled it and it still doesn’t seem to work. I’ve even tried other devices and it still doesn’t work.

@adamjnav Any tips?

Edit: After a bit more testing, the issue seems to be with ALL iOS webviews on SDK 33 and above.

Solved it myself, after going through various forum posts & articles, I found out I was using the old Webview component. All I had to do was replace the component I was using with the community-sourced one. Thanks for the help!

2 Likes

Glad you got to the bottom of things!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.