diff --git a/src/Helmet.js b/src/Helmet.js
index 12fd861c..9b982788 100644
--- a/src/Helmet.js
+++ b/src/Helmet.js
@@ -20,7 +20,7 @@ const Helmet = Component =>
* @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", "onLoad": "functionCall()"}]
+ * @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example", "onLoad": "functionCall()", "onError": "functionCall()"}]
* @param {Array} meta: [{"name": "description", "content": "Test description"}]
* @param {Array} noscript: [{"innerHTML": " console.log(newState)"
diff --git a/src/HelmetConstants.js b/src/HelmetConstants.js
index 042e2cd7..56611655 100644
--- a/src/HelmetConstants.js
+++ b/src/HelmetConstants.js
@@ -32,7 +32,8 @@ export const TAG_PROPERTIES = {
PROPERTY: "property",
REL: "rel",
SRC: "src",
- ONLOAD: "onload"
+ ONLOAD: "onload",
+ ONERROR: "onerror"
};
export const REACT_TAG_MAP = {
diff --git a/src/HelmetUtils.js b/src/HelmetUtils.js
index 4ed14226..7b3ab297 100644
--- a/src/HelmetUtils.js
+++ b/src/HelmetUtils.js
@@ -211,7 +211,12 @@ const reducePropsToState = propsList => ({
htmlAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.HTML, propsList),
linkTags: getTagsFromPropsList(
TAG_NAMES.LINK,
- [TAG_PROPERTIES.REL, TAG_PROPERTIES.HREF, TAG_PROPERTIES.ONLOAD],
+ [
+ TAG_PROPERTIES.REL,
+ TAG_PROPERTIES.HREF,
+ TAG_PROPERTIES.ONLOAD,
+ TAG_PROPERTIES.ONERROR
+ ],
propsList
),
metaTags: getTagsFromPropsList(
@@ -267,19 +272,21 @@ const rafPolyfill = (() => {
const cafPolyfill = (id: string | number) => clearTimeout(id);
-const requestAnimationFrame = typeof window !== "undefined"
- ? window.requestAnimationFrame ||
+const requestAnimationFrame =
+ typeof window !== "undefined"
+ ? window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
rafPolyfill
- : global.requestAnimationFrame || rafPolyfill;
+ : global.requestAnimationFrame || rafPolyfill;
-const cancelAnimationFrame = typeof window !== "undefined"
- ? window.cancelAnimationFrame ||
+const cancelAnimationFrame =
+ typeof window !== "undefined"
+ ? window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
cafPolyfill
- : global.cancelAnimationFrame || cafPolyfill;
+ : global.cancelAnimationFrame || cafPolyfill;
const warn = msg => {
return console && typeof console.warn === "function" && console.warn(msg);
@@ -436,9 +443,10 @@ const updateTags = (type, tags) => {
);
}
} else {
- const value = typeof tag[attribute] === "undefined"
- ? ""
- : tag[attribute];
+ const value =
+ typeof tag[attribute] === "undefined"
+ ? ""
+ : tag[attribute];
newElement.setAttribute(attribute, value);
}
}
@@ -471,9 +479,10 @@ const updateTags = (type, tags) => {
const generateElementAttributesAsString = attributes =>
Object.keys(attributes).reduce((str, key) => {
- const attr = typeof attributes[key] !== "undefined"
- ? `${key}="${attributes[key]}"`
- : `${key}`;
+ const attr =
+ typeof attributes[key] !== "undefined"
+ ? `${key}="${attributes[key]}"`
+ : `${key}`;
return str ? `${str} ${attr}` : attr;
}, "");
@@ -502,12 +511,13 @@ const generateTagsAsString = (type, tags, encode) =>
)
)
.reduce((string, attribute) => {
- const attr = typeof tag[attribute] === "undefined"
- ? attribute
- : `${attribute}="${encodeSpecialCharacters(
- tag[attribute],
- encode
- )}"`;
+ const attr =
+ typeof tag[attribute] === "undefined"
+ ? attribute
+ : `${attribute}="${encodeSpecialCharacters(
+ tag[attribute],
+ encode
+ )}"`;
return string ? `${string} ${attr}` : attr;
}, "");
diff --git a/test/HelmetDeclarativeTest.js b/test/HelmetDeclarativeTest.js
index 1636e522..a6183b93 100644
--- a/test/HelmetDeclarativeTest.js
+++ b/test/HelmetDeclarativeTest.js
@@ -50,7 +50,9 @@ describe("Helmet - Declarative API", () => {
ReactDOM.render(