WebView injectedJavaScript window scope

I have a WebView with a local html file

<WebView
  source={require('../../../index.html')}
  injectedJavaScript={'alert(window.test);'}
/>

index.html has a JS file included, inside which a value is assigned to window.test

<script type="text/javascript" src="./index.js"></script>

On a local expo setup this works, but when the files are served from cloudfront window inside injectedJavaScript does not equal to window inside the index.js file. window.test is undefined
inside injectedJavaScript

Was able to go around this by including the content of index.js inside a

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