提交 aa72dffb 编写于 作者: J Jeremy Judeaux 提交者: Robbie dela Victoria

Fix compatibility with React 16.8 (#444)

* Replace deepEqual with isEqual (#441)

(cherry picked from commit 1803f678)

* docs: 5.2.1 release

* Update travis.yml: test node 8, 10, 11; stick to npm ^5
上级 4d28f704
......@@ -2,12 +2,15 @@ language: node_js
node_js:
- 'node'
- 11
- 10
- 8
- 6
- 5
- 4
install:
- npm i -g npm@latest
- npm i -g npm@^5
- npm install
before_install:
......
<a name="5.2.1"></a>
# [5.2.1](https://github.com/nfl/react-helmet/compare/5.2.0...5.2.1) (2019-03)
### Bug Fixes
* Fix compatibility with React 16.8 ([#441](https://github.com/nfl/react-helmet/issues/441)). (Replace deepEqual with isEqual.)
<a name="5.2.0"></a>
# [5.2.0](https://github.com/nfl/react-helmet/compare/5.1.3...5.2.0) (2017-08-29)
......
此差异已折叠。
{
"name": "react-helmet",
"description": "A document head manager for React",
"version": "5.2.0",
"version": "5.2.1",
"main": "./lib/Helmet.js",
"author": "NFL <engineers@nfl.com>",
"contributors": [
......@@ -30,10 +30,10 @@
"react": ">=15.0.0"
},
"dependencies": {
"deep-equal": "^1.0.1",
"object-assign": "^4.1.1",
"react-side-effect": "^1.1.0",
"prop-types": "^15.5.4"
"prop-types": "^15.5.4",
"react-fast-compare": "^2.0.2",
"react-side-effect": "^1.1.0"
},
"devDependencies": {
"babel-cli": "^6.24.0",
......
import React from "react";
import PropTypes from "prop-types";
import withSideEffect from "react-side-effect";
import deepEqual from "deep-equal";
import isEqual from "react-fast-compare";
import {
convertReactPropstoHtmlAttributes,
handleClientStateChange,
......@@ -14,22 +14,22 @@ import {TAG_NAMES, VALID_TAG_NAMES} from "./HelmetConstants.js";
const Helmet = Component =>
class HelmetWrapper extends React.Component {
/**
* @param {Object} base: {"target": "_blank", "href": "http://mysite.com/"}
* @param {Object} bodyAttributes: {"className": "root"}
* @param {String} defaultTitle: "Default Title"
* @param {Boolean} defer: true
* @param {Boolean} encodeSpecialCharacters: true
* @param {Object} htmlAttributes: {"lang": "en", "amp": undefined}
* @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example"}]
* @param {Array} meta: [{"name": "description", "content": "Test description"}]
* @param {Array} noscript: [{"innerHTML": "<img src='http://mysite.com/js/test.js'"}]
* @param {Function} onChangeClientState: "(newState) => console.log(newState)"
* @param {Array} script: [{"type": "text/javascript", "src": "http://mysite.com/js/test.js"}]
* @param {Array} style: [{"type": "text/css", "cssText": "div { display: block; color: blue; }"}]
* @param {String} title: "Title"
* @param {Object} titleAttributes: {"itemprop": "name"}
* @param {String} titleTemplate: "MySite.com - %s"
*/
* @param {Object} base: {"target": "_blank", "href": "http://mysite.com/"}
* @param {Object} bodyAttributes: {"className": "root"}
* @param {String} defaultTitle: "Default Title"
* @param {Boolean} defer: true
* @param {Boolean} encodeSpecialCharacters: true
* @param {Object} htmlAttributes: {"lang": "en", "amp": undefined}
* @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example"}]
* @param {Array} meta: [{"name": "description", "content": "Test description"}]
* @param {Array} noscript: [{"innerHTML": "<img src='http://mysite.com/js/test.js'"}]
* @param {Function} onChangeClientState: "(newState) => console.log(newState)"
* @param {Array} script: [{"type": "text/javascript", "src": "http://mysite.com/js/test.js"}]
* @param {Array} style: [{"type": "text/css", "cssText": "div { display: block; color: blue; }"}]
* @param {String} title: "Title"
* @param {Object} titleAttributes: {"itemprop": "name"}
* @param {String} titleTemplate: "MySite.com - %s"
*/
static propTypes = {
base: PropTypes.object,
bodyAttributes: PropTypes.object,
......@@ -90,7 +90,7 @@ const Helmet = Component =>
}
shouldComponentUpdate(nextProps) {
return !deepEqual(this.props, nextProps);
return !isEqual(this.props, nextProps);
}
mapNestedChildrenToProps(child, nestedChildren) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册