Skip to content

Schema Not Showing Up On Page Source <Script /> for type="application/ld+json" #65895

Answered by S550Stang
S550Stang asked this question in Help
Discussion options

You must be logged in to vote

Thanks To @icyJoseph For Finding This Neat Nugget Hidden In The React Doc

FINALLY RENDERS INSIDE THE HEAD

**This Works Confirmed !!!**

export const Schema = ({ schema = [] }) => {
    const buildSchema = schema.map((item, index) => ({
        '@type': 'ListItem',
        position: index + 1,
        name: item.someValue,
        item: item.someUrl? item.someUrl: undefined
    }));

    return (
        schema &&
        schema.length !== 0 && (
            <script
                id="some-next-level-schema"
                async
                src=" "
                type="application/ld+json"
                dangerouslySetInnerHTML={{
                    __html: `${JSON.stringify({

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@icyJoseph
Comment options

@S550Stang
Comment options

@icyJoseph
Comment options

@S550Stang
Comment options

Answer selected by S550Stang
@S550Stang
Comment options

@icyJoseph
Comment options

@S550Stang
Comment options

@icyJoseph
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants