Easily insert valid Schema.org JSON-LD using the custom <JsonLd>
react
component.
Uses schema-dts for Schema.org TypeScript definitions.
Note: This is not an officially supported Google product.
Install react-schemaorg
and
your desired version of
schema-dts
:
npm install schema-dts
npm install react-schemaorg
Then, to insert a simple JSON-LD snippet:
import { Person } from "schema-dts";
import { JsonLd } from "react-schemaorg";
export function GraceHopper() {
return <JsonLd<Person>
item={{
"@context": "https://schema.org",
"@type": "Person",
name: "Grace Hopper",
alternateName: "Grace Brewster Murray Hopper",
alumniOf: {
"@type": "CollegeOrUniversity",
name: ["Yale University", "Vassar College"]
},
knowsAbout: ["Compilers", "Computer Science"]
}}/>;
}
Use NPM to install dependencies:
npm install
Use tsc to build:
tsc
To contribute changes, see the CONTRIBUTING.md file.