Closed seeden closed 9 years ago
It doesn't support arrays. Only strings is supported for the values.
What do you expect it to render from the array? Two tags or a comma joined value?
Output for the array is:
<meta property="fb:admins" content="1107946314">
<meta property="fb:admins" content="1095566451">
It is in the documentation of the Facebook for the fb:admins with multiple admins https://developers.facebook.com/docs/platforminsights/domains
@seeden, I was a bit to quick. Arrays is supported! And I just tested your code - it works fine. Which version of react-document-meta
are you using?
class MyComponent extends React.Component {
render() {
const basicMetadata = {
title: 'Meetbus - Make your travels more fun',
description: 'Explore awesome places around the world and meet other travelers',
meta: {
name: {
keywords: 'traveling, exploring, wanderlust, adventure, travel, meetup, new zealand'
},
property: {
'og:site_name': 'meetbus.com',
'fb:app_id': '341640709299908',
'fb:admins': [1107946314, 1095566451]
}
}
};
return (
<DocumentMeta {...basicMetadata} />
);
}
}
<head>
<title>Meetbus - Make your travels more fun</title>
<meta name="keywords" content="traveling, exploring, wanderlust, adventure, travel, meetup, new zealand" data-rdm="">
<meta name="description" content="Explore awesome places around the world and meet other travelers" data-rdm="">
<meta property="og:site_name" content="meetbus.com" data-rdm="">
<meta property="fb:app_id" content="341640709299908" data-rdm="">
<meta property="fb:admins" content="1107946314" data-rdm="">
<meta property="fb:admins" content="1095566451" data-rdm="">
</head>
Indeed there is a warning, which I'll investigate - but everything seems to work.
react-document-meta
only accept strings, so you should not have the IDs as numbers.
'fb:admins': ['1107946314', '1095566451']
There is still a warning because of the array, but that is fixed in the version coming out today.
Warning removed in react-document-meta@1.1.0
thanks
Hi after upgrade I can see this warning: Warning: Failed propType: Invalid prop
property
supplied toDocumentMeta
. Check the render method ofSideEffect(DocumentMeta)
.I am using your component:
Is there any problem with "property" field?