I’ve found this: https://www.sanity.io/plugins/sanity-plugin-seo-tools So far i’m installing and testing. But how does this work with React? Pointers as to using Sanity...

14 replies
Last updated: Sep 30, 2020
Hi, can someone give me some pointers as to using Sanity to edit SEO meta title, description etc for React pages?
Sep 30, 2020, 9:40 AM
Plain React? or Gatsby/Next?
Sep 30, 2020, 9:58 AM
Plain React
Sep 30, 2020, 9:58 AM
I assume you already have a SEO schema in Sanity
Sep 30, 2020, 9:59 AM
I’ve found this:
https://www.sanity.io/plugins/sanity-plugin-seo-tools
So far i’m installing and testing.
But how does this work with React?
Sep 30, 2020, 9:59 AM
I’ve never used this one
Sep 30, 2020, 9:59 AM
You need something like this for React https://www.npmjs.com/package/react-helmet
Sep 30, 2020, 10:00 AM
and you simply map your data from Sanity
Sep 30, 2020, 10:00 AM
ok thanks
Sep 30, 2020, 10:01 AM
🙂
Sep 30, 2020, 10:01 AM
my SEO component looks like this
Sep 30, 2020, 10:01 AM
Dude, awesome!Thanks a lot
🙂
Sep 30, 2020, 10:02 AM
The data is coming from this graphQL query
 query IndexPageQuery {
    site: sanitySite {
      title
      description
      url
      keywords
      image {
        asset {
          _id
        }
      }
    }
Sep 30, 2020, 10:04 AM
Excellent, i was just about to ask
Sep 30, 2020, 10:08 AM
😄
Sep 30, 2020, 10:08 AM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.