diff --git a/src/WebView.js b/src/WebView.js index 6d5a13e..0df9e44 100644 --- a/src/WebView.js +++ b/src/WebView.js @@ -1,4 +1,4 @@ -import React, { useState, useMemo } from 'react'; +import React, { useRef, useState, useMemo } from 'react'; import { StyleSheet, Linking, View, ActivityIndicator, Text } from 'react-native'; import { WebView } from 'react-native-webview'; import PropTypes from 'prop-types'; @@ -29,6 +29,7 @@ const WebViewComponent = ({ customAttributes = {}, closeModal, }) => { + const webViewRef = useRef(null); const [currentUrl, setCurrentUrl] = React.useState(null); const [loading, setLoading] = useState(true); let widgetUrl = `${baseUrl}/widget?website_token=${websiteToken}&locale=${locale}`; @@ -83,6 +84,7 @@ const WebViewComponent = ({ return (