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

is it okay to set meta tags in onMount? #102

Open
2 tasks done
ghost opened this issue Mar 20, 2023 · 2 comments
Open
2 tasks done

is it okay to set meta tags in onMount? #102

ghost opened this issue Mar 20, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 20, 2023

Describe the bug

This is more of a question than a bug. Right now, we are setting the title and description during onMount which will run after hydration (in client side).

Don't you think it defeats the purpose of SEO? since it won't be available in the server rendered HTML. Correct me if I am wrong.

Screenshots

No response

Reproduction

.

Logs

No response

Have you checked if this issue has already been raised?

  • I did not find any similar issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@alanxp
Copy link

alanxp commented Mar 24, 2023

Bump, this is a very good question

@omar2205
Copy link
Collaborator

The Seo component exports the meta tag values as props, like:

export let title: string;
export let description: string;

It allows to update, say the title, using a store. When we have more data to fill that component (a page title, description, and card info (title, image)) we should add them as props.

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

2 participants