rsnext/test/integration/production-swcminify/pages/regexp-polyfill.js
2021-10-25 13:49:11 +02:00

23 lines
439 B
JavaScript

import * as React from 'react'
const Home = () => {
if (typeof window !== 'undefined') {
window.didRender = true
}
React.useEffect(() => {
// If this script is loaded before the polyfills it will
// still fail
const el = document.createElement('script')
el.src = '/regexp-test.js'
document.querySelector('body').appendChild(el)
}, [])
return (
<>
<p>hi</p>
</>
)
}
export default Home