Skip to content

Conversation

@pieh
Copy link
Contributor

@pieh pieh commented Dec 15, 2025

Description

Documentation

Tests

Related Issues

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 15, 2025
@pieh pieh force-pushed the fix/react-head-document-title-alt branch from d4613a8 to c4c2e06 Compare December 18, 2025 12:45
@pieh pieh force-pushed the fix/react-head-document-title-alt branch from c016924 to 04f10e4 Compare December 18, 2025 15:22
@pieh pieh force-pushed the fix/react-head-document-title-alt branch from 04f10e4 to 8b05d9b Compare December 18, 2025 17:44
@pieh pieh changed the title check using itemprop trick instead of svg fix: remove svg workaround, use itemProp instead Dec 20, 2025
@pieh pieh marked this pull request as ready for review December 20, 2025 10:28
@pieh pieh merged commit 1db049a into fix/react-head-document-title Dec 20, 2025
70 checks passed
@pieh pieh deleted the fix/react-head-document-title-alt branch December 20, 2025 10:29
pieh added a commit that referenced this pull request Dec 22, 2025
…39382)

* chore: add retries to flaky test

* refactor: move guard earlier and colocate with comment

* ci: disable browserslist console warnings

These are nondeterministic and conflict with test output assertions

* fix: ensure inserting <title> in <head> updates `document.title`

In #39306 we introduced a workaround that wraps the Gatsby
Head API elements in an `<svg>` wrapper. React under the hood creates these children elements in the
"SVG" namespace. In the case of `<title>`, this is problematic because when we insert it into the
real `<head>`, browsers (as far as we can tell) do not trigger an update of `document.title` because
this only occurs for `<title>` nodes in the HTML namespace. A node's namespace is immutable, even
when using `cloneNode()` or `importNode()`. The only way to "reset" the namespace is to recreate a
node.

* fix: remove svg workaround, use itemProp instead (#39385)

* test: expand navigation tests to test if effects are applied and not just if tags are inserted/updated/removed

* fix: remove svg workaround, use itemProp instead

* fix: don't break rules of hooks in createElement patch

---------

Co-authored-by: Michal Piechowiak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants