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

fix: Keep empty meta from rendering a tag #2411

Merged
merged 3 commits into from
Mar 21, 2022
Merged

Conversation

chaance
Copy link
Collaborator

@chaance chaance commented Mar 20, 2022

Currently, if a meta key is null or undefined, we will render an empty tag. Our types also don't support an empty meta key, which is a bit annoying if you're working with optional data.

export function meta({ data }) {
  return {
    title: data.title, // always there, cool
    description: data.description // optional, don't bother with a tag but please don't yell at me!
  };
}

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ma superfan of this change 👍

fixtures/gists-app/app/routes/meta.tsx Show resolved Hide resolved
@chaance chaance merged commit eb343b6 into dev Mar 21, 2022
@chaance chaance deleted the chance/allow-empty-meta branch March 21, 2022 16:34
MichaelDeBoey pushed a commit to TheRealAstoo/remix that referenced this pull request Mar 21, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants