Skip to content

How to support dynamic meta tags which are asynchronously resolved  #11

@Amila-Rukshan

Description

@Amila-Rukshan

So far I managed to adapt this boilerplate code for my project. Now I need to support dynamic meta tags for some routes. These components receive the meta tags using an API call to the server. Actually meta tags are set and viewable via inspecting the browser. But Facebook sharing debugger only reads the static meta tags.

<Helmet>
         <title>{this.state.firstName+' '+this.state.lastName}</title>
         <meta name="og:description" content={this.state.description+" this is my profile"} />
         <meta property="og:image" content={"/images/share/home page share.jpeg"}
</Helmet>

state values are set by an API call inside the component. In the above example og:image is set as it is static. og:description only has static portion after scraped by facebook sharing debugger. Am I missing some step? data to be set meta tags are loaded in compnentWillMount life cycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions