Skip to content

Commit 8c60a2e

Browse files
ismamztimneutkens
authored andcommitted
Fix with-amp example (vercel#3153)
React v16 supports invalid DOM attributes now. ReactInjection and DOMProperty throws an error. Reference: vercel#3152
1 parent e5c46c2 commit 8c60a2e

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

examples/with-amp/pages/_document.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
import Document, { Head } from 'next/document'
2-
import { DOMProperty } from 'react-dom/lib/ReactInjection'
3-
import { properties as DOMProperties } from 'react-dom/lib/DOMProperty'
4-
5-
// By default React limit the set of valid DOM elements and attributes
6-
// (https://github.com/facebook/react/issues/140) this config whitelist
7-
// Amp elements/attributes
8-
if (typeof DOMProperties.amp === 'undefined') {
9-
DOMProperty.injectDOMPropertyConfig({
10-
Properties: { amp: DOMProperty.MUST_USE_ATTRIBUTE },
11-
isCustomAttribute: attributeName => attributeName.startsWith('amp-')
12-
})
13-
}
142

153
export default class MyDocument extends Document {
164
render () {

0 commit comments

Comments
 (0)