Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-react-head

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-react-head

Manage document head data with react-head. Provides drop-in server rendering support for Gatsby.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
decreased by-32.26%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-react-head

Provides 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.

Why no react-helmet?

Size comparison:

PackageSize
react-helmetbundlephobia
react-headbundlephobia

React Helmet is great and has more features than React Head, but sometimes you want less than more.

Install

npm i gatsby-plugin-react-head react-head

or

yarn add gatsby-plugin-react-head react-head

How to use

Add the plugin to the plugins array in your gatsby-config.js

plugins: [`gatsby-plugin-react-head`];

You don't have to do anything else. Render one of head tag components whenever you want to inject a tag in the <head />.

import React from "react";
import { Title, Link, Meta } from "react-head";

const Seo = () => (
  <>
    <Title>Hello world!</Title>
    <Meta name="description" content="Lorem ipsum dolor sit amet." />
    <Link rel="canonical" content="https://bejamas.io/" />
  </>
);

Further reading:

  1. React Head documentation

Keywords

FAQs

Package last updated on 27 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc