spee.ch/react/components/SEO/index.jsx

25 lines
549 B
React
Raw Normal View History

2018-02-23 20:00:46 +01:00
import React from 'react';
import Helmet from 'react-helmet';
import PropTypes from 'prop-types';
class SEO extends React.Component {
render () {
const { pageTitle, metaTags, canonicalLink } = this.props;
return (
<Helmet
title={pageTitle}
link={[{rel: 'canonical', href: canonicalLink}]}
meta={metaTags}
/>
);
}
};
SEO.propTypes = {
pageTitle : PropTypes.string.isRequired,
metaTags : PropTypes.array.isRequired,
canonicalLink: PropTypes.string.isRequired,
};
export default SEO;