Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add JSX.ElementChildrenAttribute change to TypeScript 5.8 release notes

Abierto Apto para principiantes
#63,212 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
68/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
typescript

Línea de trabajo

Revisar el PR 60880 y el issue 61354 para confirmar el cambio de comportamiento de JSX.ElementChildrenAttribute y, a continuación, compararlo con las notas de la versión de TypeScript 5.8. Actualizar la página de release-notes de 5.8 para describir el cambio incompatible y su efecto en la inferencia de children, usando como contexto el ejemplo twrl reportado.

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

Descripción

Docs
🔎 Search Terms

tsx, jsx, children, 5.8

🕗 Version & Regression Information
  • This changed between versions 5.7.3 and 5.8
  • This changed in commit or PR 60880
⏯ Playground Link

No response

💻 Code
declare global {
  namespace JSX {
    type Element = HTMLElement; /* return type for 'jsx()' */

    /* accepted element tags & attributes */
    type IntrinsicElements = {
      /* All HTML elements */
      [Tag in keyof HTMLElementTagNameMap]: {
        [T in HTMLElementStringAttributes<Tag>]?: string | Dyn<string>;
      } & {
        [T in HTMLElementNumberAttributes<Tag>]?: number | Dyn<number>;
      } & (Tag extends keyof TwrlOverrides ? TwrlOverrides[Tag] : {}) & {
          style?: string /* note: This should probably be CSSStyleDeclaration */;
          // BREAKS HERE without this: children?: Children /* defines the type of children */;
        };
    };
  }
}
🙁 Actual behavior

The breaking change is not listed in the 5.8 Release Notes

🙂 Expected behavior

The breaking change should be listed in the 5.8 Release Notes

Additional information about the issue

I ran into issues when upgrading TypeScript and narrowed it down to 5.7.3 to 5.8. The issues is that children is not inferred by default.

Luckily I came across this discussion: https://github.com/microsoft/TypeScript/issues/61354

This led me to this PR: https://github.com/microsoft/TypeScript/pull/60880

It would have been much faster if the (breaking) change had been mentioned in the 5.8 release notes. Moreover, one (apparent?) side effect of #61354 is that children does not have a default anymore (i.e. if JSX.ElementChildrenAttribute is not set, pre-5.8 children would be accepted; post-5.8 not anymore).

Here's the JSX implementation that surfaced the issue for me:

declare global {
  namespace JSX {
    type Element = HTMLElement; /* return type for 'jsx()' */

    /* accepted element tags & attributes */
    type IntrinsicElements = {
      /* All HTML elements */
      [Tag in keyof HTMLElementTagNameMap]: {
        [T in HTMLElementStringAttributes<Tag>]?: string | Dyn<string>;
      } & {
        [T in HTMLElementNumberAttributes<Tag>]?: number | Dyn<number>;
      } & (Tag extends keyof TwrlOverrides ? TwrlOverrides[Tag] : {}) & {
          style?: string /* note: This should probably be CSSStyleDeclaration */;
          children?: Children /* defines the type of children */; // <- this is now REQUIRED
        };
    };
  }
}

Fix: https://github.com/nmattia/twrl/commit/d83fde44202536c52f2816094fdcc4910c945c85#diff-8e3158c55134a198f9c40ac714ce358df04312a9ca77d7726e1813fb2ba5b5c0R34

Lenguaje dominante
Go
Estrellas
111k
Forks
14.4k
Merge medio
2 d 3 h
PR fusionados (30 d)
125

Guía de contribución

Abrir la guía de contribución

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 microsoft/TypeScript

Todos los issues de microsoft/TypeScript

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.