From 422c6318329670bb2997f27c2696b1c8f5f8c156 Mon Sep 17 00:00:00 2001 From: Matthew Mueller Date: Thu, 15 Dec 2016 00:05:20 -0600 Subject: [PATCH] remove react-dom/lib/HTMLDOMPropertyConfig for better interop (#392) --- client/head-manager.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/head-manager.js b/client/head-manager.js index 15043f08..ab8609e7 100644 --- a/client/head-manager.js +++ b/client/head-manager.js @@ -1,7 +1,13 @@ -import HTMLDOMPropertyConfig from 'react-dom/lib/HTMLDOMPropertyConfig' const DEFAULT_TITLE = '' +const DOMAttributeNames = { + acceptCharset: 'accept-charset', + className: 'class', + htmlFor: 'for', + httpEquiv: 'http-equiv', +} + export default class HeadManager { constructor () { this.requestId = null @@ -68,7 +74,7 @@ function reactElementToDOM ({ type, props }) { if (!props.hasOwnProperty(p)) continue if (p === 'children' || p === 'dangerouslySetInnerHTML') continue - const attr = HTMLDOMPropertyConfig.DOMAttributeNames[p] || p.toLowerCase() + const attr = DOMAttributeNames[p] || p.toLowerCase() el.setAttribute(attr, props[p]) }