Skip to content

Commit

Permalink
Fix with-amp example (vercel#3153)
Browse files Browse the repository at this point in the history
React v16 supports invalid DOM attributes now. 
ReactInjection and DOMProperty throws an error.
Reference: vercel#3152
  • Loading branch information
ismamz authored and timneutkens committed Oct 23, 2017
1 parent e5c46c2 commit 8c60a2e
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions examples/with-amp/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,16 1,4 @@
import Document, { Head } from 'next/document'
import { DOMProperty } from 'react-dom/lib/ReactInjection'
import { properties as DOMProperties } from 'react-dom/lib/DOMProperty'

// By default React limit the set of valid DOM elements and attributes
// (https://github.com/facebook/react/issues/140) this config whitelist
// Amp elements/attributes
if (typeof DOMProperties.amp === 'undefined') {
DOMProperty.injectDOMPropertyConfig({
Properties: { amp: DOMProperty.MUST_USE_ATTRIBUTE },
isCustomAttribute: attributeName => attributeName.startsWith('amp-')
})
}

export default class MyDocument extends Document {
render () {
Expand Down

0 comments on commit 8c60a2e

Please sign in to comment.