File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import Document , { Head } from 'next/document'
2
2
import { DOMProperty } from 'react-dom/lib/ReactInjection'
3
+ import { properties as DOMProperties } from 'react-dom/lib/DOMProperty'
3
4
4
5
// By default React limit the set of valid DOM elements and attributes
5
6
// (https://github.com/facebook/react/issues/140) this config whitelist
6
7
// Amp elements/attributes
7
- DOMProperty . injectDOMPropertyConfig ( {
8
- Properties : { amp : DOMProperty . MUST_USE_ATTRIBUTE } ,
9
- isCustomAttribute : attributeName => attributeName . startsWith ( 'amp-' )
10
- } )
8
+ if ( typeof DOMProperties . amp === 'undefined' ) {
9
+ DOMProperty . injectDOMPropertyConfig ( {
10
+ Properties : { amp : DOMProperty . MUST_USE_ATTRIBUTE } ,
11
+ isCustomAttribute : attributeName => attributeName . startsWith ( 'amp-' )
12
+ } )
13
+ }
11
14
12
15
export default class MyDocument extends Document {
13
16
render ( ) {
You can’t perform that action at this time.
0 commit comments