Skip to content

Bug: cannot remove/clear document titleΒ #710

@JakeSidSmith

Description

@JakeSidSmith

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Attempting to remove a title with any of the following does not remove the title: <title>{''}</title>, <title>{undefined}</title>, <title />

Minimal reproduction: https://codepen.io/jakesidsmith/pen/abPLPxm

What is the expected behavior?

The document title should be removed (set to empty string).

Which versions of React and react-helmet, and which browser / OS are affected by this issue?
Did this work in previous versions of React and/or react-helmet?

I have not tested any other versions.

Additional notes:

This is a particularly frustrating limitation as I intend to use react-helmet within one of my libraries, so I won't have control over users' code, but I want users of my library to be able to see where they have forgotten to add a title and currently (because react-helmet maintains the previous title) it is hard to know where titles have been missed. To make things worse, only after reloading the page, or a user navigating to a page for the first time will the missing title be highlighted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions