Commit 8c60a2e3 authored by Ismael Martínez's avatar Ismael Martínez Committed by Tim Neutkens

Fix with-amp example (#3153)

React v16 supports invalid DOM attributes now. 
ReactInjection and DOMProperty throws an error.
Reference: #3152
parent e5c46c26
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 () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment