Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

[QUESTION] Is possible to change __typename for title? #10

Open
sixtyniner-official opened this issue Mar 19, 2019 · 1 comment
Open

Comments

@sixtyniner-official
Copy link

Hi,

on my current project have following function:

_headMetaTagRedered(typename, key, value, index) {
       switch (typename) {
           case "MetaLink":
               return(
                   <link key={index} rel={key} href={value} />
               );
           case "MetaValue":
               return(
                   <meta key={index} name={key} content={value}/>
               );
           default:
               return;
       }
   };

Idea is to print all meta tags in one loop

<Head>
    {data.route.entity.metaTags.map((tag, index) => {
           return(
                this._headMetaTagRedered( tag.__typename, tag.key, tag.value, index)
          )
     })}
</Head>

But key value for title is MetaValue so is not possible to make right switch case check to print <title>{value}</title>

Could you consider the case above and give as feedback if title have to be MetaValue?

@Luigisa
Copy link

Luigisa commented Nov 20, 2020

Hi, you can add an alias before:

title: tag.__typename

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants