Created
March 14, 2025 19:41
-
-
Save slicksammy/0ca3b1d9668a67b623a23fee809c6700 to your computer and use it in GitHub Desktop.
how to create native view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // somehwere you make a request and get back data (which is a checkout) | |
| setCheckoutUrl(`https://wallet.paywithsoap.com/?clientSecret=${data.client_secret}`); | |
| return ( | |
| <SafeAreaView style={backgroundStyle}> | |
| <View style={styles.webViewHeader}> | |
| <TouchableOpacity onPress={closeWebView} style={styles.closeButton}> | |
| <Text style={styles.closeButtonText}>✕</Text> | |
| </TouchableOpacity> | |
| <Text style={styles.webViewTitle}>Checkout</Text> | |
| </View> | |
| <WebView | |
| source={{uri: checkoutUrl}} | |
| originWhitelist={['*']} | |
| javaScriptEnabled={true} | |
| domStorageEnabled={true} | |
| startInLoadingState={true} | |
| allowsInlineMediaPlayback={true} | |
| scalesPageToFit={true} | |
| /> | |
| </SafeAreaView> | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment