Hi Ben -
So far it's been great for easily setting up the structured data for a page in React.
When we inspect the page where this is being utilised it shows the structured data correctly - however, (and I'm not sure if this is an issue as such) we noticed that when using SSR and we view the page source where tool is being used, the quotes in our structured data gets output as Unicode i.e. "
We've written our React component as such:
import React from 'react';
import { JSONLD, Generic } from 'react-structured-data';
const StructuredData = (props) => {
let image = !image ? `https:${props.stageImage}` : `https:${props.office.images[0]}`;
return (
<JSONLD>
<Generic type="LocalBusiness"
jsonldtype="LocalBusiness"
schema={{
name: props.office.name,
telephone: props.office.generalNumber,
openingHours: props.office.openingHours,
image
}}>
<Generic type="address"
jsonldtype="PostalAddress"
schema={{
streetAddress: props.office.listedAddress2.streetAddress,
addressCountry: props.office.listedAddress2.country,
addressLocality: props.office.listedAddress2.addressLocality,
postalCode: props.office.listedAddress2.postalCode
}} />
</Generic>
</JSONLD>
);
};
export default StructuredData;
when we inspect the page it looks like this:
<script type="application/ld+json">{"@context":"http://schema.org/","@type":"LocalBusiness","name":"Barcelona","telephone":"933 67 26 00 ","openingHours":"Lunes a Viernes: 09:30 a 20:00","image":"https://mediaqa.ef.com/~/media/centralefcom/contact/ef-headquarters2.png","address":{"@type":"PostalAddress","streetAddress":"Carrer de Balmes 157","addressCountry":"España","addressLocality":"Barcelona","postalCode":"08008"}}</script>
and view page source it looks like this:
<script type="application/ld+json">{"@context":"http://schema.org/","@type":"LocalBusiness","name":"Barcelona","telephone":"933 67 26 00 ","openingHours":"Lunes a Viernes: 09:30 a 20:00","image":"https://mediaqa.ef.com/~/media/centralefcom/contact/ef-headquarters2.png","address":{"@type":"PostalAddress","streetAddress":"Carrer de Balmes 157","addressCountry":"España","addressLocality":"Barcelona","postalCode":"08008"}}</script>
If I'm not mistaken and according to our SEO team they say that this will be ignored by Google crawlers, making our SEO on the necessary page, redundant.
Any help would be much appreciated!
Gareth