I have an inline script that call a function declared in an external script. Unfortunately the inline script is executed before the external script is loaded and a function undefined error appear.
<Helmet>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"
/>
<script>
{`
console.log('Test', typeof $);
`}
</script>
</Helmet>
The issue can be seen here:
https://codesandbox.io/s/l9qmrwxqzq
It suddenly works if the page is refreshed by inserting some characters right after the closing helmet tag, but at first load the function remain undefined.
Tried multiple things like declaring both as helmet params, or inserting them in separate helmet tags but none of these worked.