11import * as React from "react" ;
22import { connect } from "react-redux" ;
3- import MetaTags from "react-meta-tags " ;
3+ import { Helmet } from "react-helmet-async " ;
44import { AppState } from "../../store/state" ;
55import { DemoHtmlMetadata , selectHtmlMetadata } from "../../store/selectors/metadata" ;
66
@@ -14,16 +14,13 @@ class MetadataComponent extends React.Component<StateProps, {}> {
1414 const { metadata } = this . props ;
1515 const { title, description, image, url } = metadata ;
1616
17- const descriptionTags = description && < >
18- < meta name = "description" content = { description } />
19- < meta property = "og:description" content = { description } />
20- < meta property = "twitter:description" content = { description } />
21- </ > ;
22-
23- return < MetaTags >
17+ return < Helmet >
2418 < title > { title } </ title >
25- { descriptionTags }
2619
20+ { description && < meta name = "description" content = { description } /> }
21+ { description && < meta property = "og:description" content = { description } /> }
22+ { description && < meta property = "twitter:description" content = { description } /> }
23+
2724 < meta property = "og:site_name" content = "RavenDB Demo" />
2825 < meta property = "og:type" content = "website" />
2926 < meta property = "og:title" content = { title } />
@@ -37,7 +34,7 @@ class MetadataComponent extends React.Component<StateProps, {}> {
3734 < meta property = "twitter:title" content = { title } />
3835 < meta property = "twitter:image" content = { image } />
3936 < meta property = "twitter:url" content = { url } />
40- </ MetaTags > ;
37+ </ Helmet > ;
4138 }
4239}
4340
0 commit comments