Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Amila-Rukshan opened this issue Jun 21, 2020 · 0 comments
Open

Comments

@Amila-Rukshan
Copy link

Amila-Rukshan commented Jun 21, 2020

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.

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

No branches or pull requests

1 participant