Skip to content

Commit

Permalink
Fix missing interpolation on next/head exports (#36435)
Browse files Browse the repository at this point in the history
fixes #36183



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
Brooooooklyn committed Apr 26, 2022
1 parent 994f182 commit 26efcc5
Show file tree
Hide file tree
Showing 2 changed files with 16 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')
var head = require('./dist/shared/lib/head')
Object.assign(head.default, head)
module.exports = head.default
13 changes: 13 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,23 @@ 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" />
</Head>
<Script
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: 'console.log("hello world")',
}}
/>
<p>hello world</p>
<Link href="/modules">
<a id="link-to-module">link to module</a>
Expand Down

0 comments on commit 26efcc5

Please sign in to comment.