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

Suffix support? #45

Open
hakunin opened this issue Jun 27, 2017 · 2 comments
Open

Suffix support? #45

hakunin opened this issue Jun 27, 2017 · 2 comments

Comments

@hakunin
Copy link

hakunin commented Jun 27, 2017

Hi, it would be nice if there was a global suffix support.

This is how I imagine it could work API-wise:

Root level, producing MyApp.

<DocumentTitle title="null" suffix="MyApp" separator=" | ">
 ...
</DocumentTitle>

Inside a specific page, producing Index | MyApp.

<DocumentTitle title="null" suffix="MyApp" separator=" | ">
   <DocumentTitle title="Index">...<DocumentTitle>
</DocumentTitle>

There could be also custom format function for those who need more power:

<DocumentTitle title="null" format={(value) => value ? value+' | MyApp' : 'MyApp'}>
   ...
</DocumentTitle>
@sman591
Copy link

sman591 commented Jan 25, 2018

A similar proposal was mentioned in #6 with a potential solution (wrapping the component)

@tajo
Copy link

tajo commented Apr 8, 2018

@hakunin I had same use-case so I've created similar library that supports that API: react-titled

It was hard to add support for it here since react-document-title has fundamentally different implementation (not using context).

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

3 participants