google / react-schemaorg

Type-checked Schema.org JSON-LD for React
Apache License 2.0
487 stars 19 forks source link

Support using <script> tags directly. #24

Closed Eyas closed 4 years ago

Eyas commented 4 years ago

Fixes #23. Some tools such as next/head rely on a script tag existing directly under the <Head> component. Allowing a react-schemaorg user just pass the props opaquely to a <script> tag gives us both encapsulation while getting the library to work.

Our public API surface area is now effectivley 3 pieces: the original JSON-LD component, a function generating Helmet-style props, and this function, which generates plain JSX-style props for <script>.

Eyas commented 4 years ago

@sebastienlabine fyi

sebastienlabine commented 4 years ago

@Eyas Looks good! Great work!