Привет. Вариантов в принципе не много, вернее вариантов много, но, нормальных 1-2, приведу их ниже:
Ты можешь использовать react-helmet.
Например:
import React from 'react'
import Helmet from 'react-helmet'
import { useIntl } from 'react-intl'
import messages from './messages'
export const Seo = () => {
const intl = useIntl()
const title = intl.formatMessage(messages.title)
const description = intl.formatMessage(messages.description)
return (
<Helmet
htmlAttributes={{ lang: intl.locale }}
title={title}
titleTemplate={`%s | ${title}`}
meta={[
{
name: 'description',
content: description,
},
{
property: 'og:title',
content: title,
},
{
property: 'og:description',
content: description,
},
{
property: 'og:type',
content: 'website',
},
{
name: 'twitter:card',
content: 'summary',
},
{
name: 'twitter:title',
content: title,
},
{
name: 'twitter:description',
content: description,
},
]}
/>
)
}
Для sitemap можешь использовать
react-router-sitemap
import { Router, Route, IndexRoute, Redirect, IndexRedirect } from 'react-router'
import React from 'react';
export default (
<Router>
<Route path="/">
<IndexRoute/>
<Route path="test" />
<Route path="posts(/:page)" />
<Route path="article/:hrefTitle" />
<Route path="tags/:tagName" />
<Route path="tags/pages/(:page)" />
<Route path="archive(/:searchKey)" />
<Redirect path="*" to="/" />
</Route>
</Router>
)