Manage document head data with react-head. Provides drop-in server rendering support for Gatsby.
npm install gatsby-plugin-react-headProvides drop-in support for server rendering data added with
React Head.
React Head is a component which lets you control your document head using
their React component.
With this plugin, attributes you add in their component, e.g. title, meta
attributes, etc. will get added to the static HTML pages Gatsby builds.
This is important not just for site viewers, but also for SEO -- title and description metadata stored in the document head is a key component used by Google in determining placement in search results.
Size comparison:
| Package | Size |
| -------------- | -------------------------------------------------------------------------------------------------------------------- |
| react-helmet |  |
| react-head |  |
React Helmet is great and has more features than React Head, but sometimes you want less than more.
npm i gatsby-plugin-react-head react-head
or
yarn add gatsby-plugin-react-head react-head
Add the plugin to the plugins array in your gatsby-config.js
``javascriptgatsby-plugin-react-head
plugins: [];`
You don't have to do anything else. Render one of head tag components whenever you want to inject a tag in the
.`javascript
import React from "react";
import { Title, Link, Meta } from "react-head";const Seo = () => (
<>
Hello world!
>
);
``