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

Abierto Apto para principiantes
#8,840 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Rohan-Dedhia ya está trabajando en esto.

Desde el 4/11/2026.

  • #8873 de @Rohan-Dedhia — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
html, react, typescript

Línea de trabajo

La guía es la página del head del documento SPA en la documentación de TanStack Router, donde aparece la instrucción de eliminar el <title> estático de index.html junto con <HeadContent />. Lee esa sección y luego la discusión enlazada #1056 para el contexto previo sobre los títulos de las rutas. Está terminado cuando la documentación explica por qué hay que quitar el título estático, cómo se ve el HTML inicial sin él, y recomienda prerenderizado o SSR para metadatos específicos de cada ruta, con un patrón de respaldo compatible.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
15.3k
Forks
1.9k
Merge medio
1 d 7 h
PR fusionados (30 d)
63

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/router

Todos los issues de TanStack/router

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.