diff --git a/autoHeightWebView/utils.js b/autoHeightWebView/utils.js index 6e16e2b..7927043 100644 --- a/autoHeightWebView/utils.js +++ b/autoHeightWebView/utils.js @@ -128,8 +128,9 @@ const getBaseScript = ({ }) => ` ; - if (!document.getElementById("rnahw-wrapper")) { - var wrapper = document.createElement('div'); + var wrapper = document.getElementById("rnahw-wrapper"); + if (!wrapper) { + wrapper = document.createElement('div'); wrapper.id = 'rnahw-wrapper'; while (document.body.firstChild instanceof Node) { wrapper.appendChild(document.body.firstChild);