docs(router): clarify static title fallback in SPA mode

オープン 初心者向け
#8,840 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
html, react, typescript
領域
documentation

調査の方向性

このガイドは TanStack Router のドキュメントにある SPA ドキュメントの head ページで、index.html から静的な <title> を削除する指示が <HeadContent /> と並んで書かれています。そのセクションを読んだうえで、ルートのタイトルに関する以前の経緯として、リンク先のディスカッション #1056 を確認してください。完了の条件は、ドキュメントが静的タイトルを削除しなければならない理由、削除後の初期 HTML の姿、そしてルート固有のメタデータにはプリレンダリングまたは SSR を推奨し、サポートされたフォールバックパターンを示すことです。

索引モデルが issue の本文から書いたものです。

説明

What would you like to see?

The SPA document head guide says to remove the static <title> from index.html when using <HeadContent />. It would help to explain why this is necessary and what to do if the app still needs a fallback title before JavaScript runs.

In SPA mode, the initial HTML response is the same for every route, so route-specific metadata is only available after the router runs. A static title can provide a useful fallback, but HeadContent currently doesn't adopt or replace that unmanaged title, so leaving it in place can result in duplicate titles.

Could the docs clarify this trade-off and recommend prerendering or SSR when route-specific metadata needs to be present in the initial HTML? It would also be useful to mention a supported pattern for retaining a generic fallback title without leaving duplicate title elements after the app starts.

Why is this needed?

Some apps don't need search indexing, but still want a sensible browser-tab title if JavaScript is disabled, blocked, or fails to load. The current instruction to remove the title is easy to follow without realizing that the initial document then has no title until client-side rendering.

I found the existing discussion about route titles: https://github.com/TanStack/router/discussions/1056

主要言語
TypeScript
スター
15.3k
フォーク
1.9k
平均マージ
1日 5時間
マージ済み PR(30日)
58

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/router のほかの issue

TanStack/router の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。