Skip to content

Commit c6627e3

Browse files
authored
chore(gatsby-plugin-react-helmet): Add deprecation notice (#36166)
1 parent ca6ba62 commit c6627e3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/gatsby-plugin-react-helmet/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ attributes, etc. will get added to the static HTML pages Gatsby builds.
1111

1212
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.
1313

14+
## ⚠️ This package will be deprecated
15+
16+
The `gatsby-plugin-react-helmet` package will be deprecated in the future. The new [Gatsby Head API](https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-head/) is easier to use, more performant, has a smaller bundle size, and supports the latest React features. Update to `gatsby@^4.19.0` to use it.
17+
1418
## Install
1519

16-
`npm install gatsby-plugin-react-helmet react-helmet`
20+
```shell
21+
npm install gatsby-plugin-react-helmet react-helmet
22+
```
1723

1824
## How to use
1925

@@ -38,7 +44,3 @@ If you are using this plugin with React hooks, you may notice some errors like `
3844
- You have updated to the latest version of `gatsby-plugin-react-helmet`
3945
- You are using version 6.0.0-beta or later of `react-helmet`
4046
- You are importing React Helmet using `import { Helmet } from 'react-helmet'` rather than the old `import Helmet from 'react-helmet'`
41-
42-
## Examples
43-
44-
- [gatsby-starter-blog](https://github.com/gatsbyjs/gatsby/blob/master/starters/blog/src/components/seo.js)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
exports.pluginOptionsSchema = ({ Joi }) => Joi.object({})
2+
3+
exports.onPreInit = ({ reporter }) => {
4+
reporter.warn(
5+
`gatsby-plugin-react-helmet: Gatsby now has built-in support for modyfing the document head. Learn more at https://gatsby.dev/gatsby-head`
6+
)
7+
}

0 commit comments

Comments
 (0)