Skip to content

Commit

Permalink
Fix missing interpolation on next/head exports
Browse files Browse the repository at this point in the history
fixes #36183
  • Loading branch information
Brooooooklyn committed Apr 25, 2022
1 parent a628256 commit 5fd0b6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/head.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = require('./dist/shared/lib/head')
const head = require('./dist/shared/lib/head')
Object.assign(head.default, head)
module.exports = head.default
14 changes: 14 additions & 0 deletions test/e2e/type-module-interop/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@ describe('Type module interop', () => {
files: {
'pages/index.js': `
import Link from 'next/link'
import Head from 'next/head'
import Script from 'next/script'
export default function Page() {
return (
<>
<Head>
<title>This page has a title 🤔</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<Script
id="stripe-js"
src="https://js.stripe.com/v3/"
onLoad={() => {
setStripe({ stripe: window.Stripe('pk_test_12345') })
}}
/>
</Head>
<p>hello world</p>
<Link href="/modules">
<a id="link-to-module">link to module</a>
Expand Down

0 comments on commit 5fd0b6d

Please sign in to comment.