Skip to content

Support using <script> tags directly.#24

Merged
Eyas merged 2 commits intogoogle:masterfrom
Eyas:direct-script
Jul 20, 2020
Merged

Support using <script> tags directly.#24
Eyas merged 2 commits intogoogle:masterfrom
Eyas:direct-script

Conversation

@Eyas
Copy link
Collaborator

@Eyas Eyas commented Jul 20, 2020

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>.

Fixes google#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
Copy link
Collaborator Author

Eyas commented Jul 20, 2020

@sebastienlabine fyi

@Eyas Eyas merged commit 796fa93 into google:master Jul 20, 2020
@sebastienlabine
Copy link

@Eyas Looks good! Great work!

@Eyas Eyas deleted the direct-script branch March 29, 2022 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider renaming helmetJsonLdProp to a more general name / Support for NextJS

2 participants