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

Support cascading tags #11

Closed
tizmagik opened this issue Oct 11, 2017 · 10 comments
Closed

Support cascading tags #11

tizmagik opened this issue Oct 11, 2017 · 10 comments

Comments

@tizmagik
Copy link
Owner

tizmagik commented Oct 11, 2017

A potentially useful feature is the ability to support cascading tags with the same tag and/or name attribute.

This may be just a matter of collecting tags to an associative array (object) where the key is the tag name and then overriding previously collected tags as the components render in order.

Similar functionality exists in react-helmet which is inspiration for this library to begin with

@TrySound
Copy link
Collaborator

Does this issue mean such api?

<Head>
  <title></title>
  <meta />
</Head>

@tizmagik
Copy link
Owner Author

It means something like this:

<div>
  <Title>Some upper title</Title>
  <div>
    <div><Title>Some nested title</Title></div>
  </div>
</div>

Once the rendering is done, the "winning" Title should be Some nested title

@TrySound
Copy link
Collaborator

What is the current behaviour? The winner is the first one?

@tizmagik
Copy link
Owner Author

Yes, I believe so

@TrySound
Copy link
Collaborator

I checked it. Seems like it is browser behaviour. They love to make things harder.

TrySound added a commit that referenced this issue Jul 10, 2018
Ref #11

This PR is cascading titles MVP. My project requires similar to helment
behaviour for titles.
TrySound added a commit that referenced this issue Jul 11, 2018
Ref #11

This PR is cascading titles MVP. My project requires similar to helment
behaviour for titles.
TrySound added a commit that referenced this issue Jul 11, 2018
Ref #11

This PR is cascading titles MVP. My project requires similar to helment
behaviour for titles.
TrySound added a commit that referenced this issue Jul 12, 2018
TrySound added a commit that referenced this issue Jul 12, 2018
TrySound added a commit that referenced this issue Jul 12, 2018
TrySound added a commit that referenced this issue Jul 14, 2018
@TrySound
Copy link
Collaborator

Cascading is supported for title and meta tags. Can this be closed?

@tizmagik
Copy link
Owner Author

Yes, I think so. Thanks @TrySound

Closed via #39 and #37

zhangciwu pushed a commit to zhangciwu/react-head that referenced this issue Aug 10, 2018
Ref tizmagik#11

This PR is cascading titles MVP. My project requires similar to helment
behaviour for titles.
zhangciwu pushed a commit to zhangciwu/react-head that referenced this issue Aug 10, 2018
@juan-bastidas
Copy link

juan-bastidas commented Mar 15, 2019

Is there a way to about some Links to be duplicated, especially canonical?
I've found it repeated 3 times

<link rel="canonical" content="http://jeremygayed.com/" />

@tizmagik
Copy link
Owner Author

@juan-bastidas mind creating a new issue? I'm not sure what's the use case to avoid duplicate canonical links -- that's not typically a tag that needs to cascade, but I'd be happy to review your use case in more detail in a new issue.

@juan-bastidas
Copy link

Sorry, I was about to upload a demo project when I found that it was due to an error in my side, react-head is OK

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

No branches or pull requests

3 participants