react-structured-data

React Structured Data

React Structured Data provides an easy way to add structured data to your React apps. Structured data is a standardized format for providing information about a page and classifying the page content. This library follows guidelines specified at http://schema.org/.

Installation

Yarn

yarn add react-structured-data

NPM

npm install react-structured-data --save

Code Example

The following JSX:

<JSONLD><Productname="Product Name"><AggregateRatingratingValue={4.3}reviewCount={197}/><GenericCollectiontype="review"><Reviewname="It's awesome"reviewBody="This is Great! My family loves it"datePublished="11/22/1963"><Authorname="Jerry"/><Locationname="Chicago, IL"/><RatingratingValue={5}/></Review><Reviewname="Very cool"reviewBody="I like this a lot. Very cool product"datePublished="11/22/1963"><Authorname="Cool Carl"/><Locationname="Chicago, IL"/><RatingratingValue={4}/></Review></GenericCollection></Product></JSONLD>

This may seem not as ideal as using the presets, but this allows completely customizable structured data.
There will also be more preset components to come in future releases to make implementation easier so stay tuned!

Structured Data and Schema.org

For more information on Structured data, visit https://developers.google.com/search/docs/guides/intro-structured-data, and also http://schema.org/.
You can also validate the structured data here: https://search.google.com/structured-data/testing-tool.