Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /