rsnext/test/integration/production/pages/regexp-polyfill.js
JJ Kasper 9943334d44
Update RegExp test and remove extra script (#11006)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-12 14:24:44 -04: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