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

Suspense mode resumes with the previous observable's value on React 19

Abierto
#793 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Ejecuta npx vitest run useObservable y empieza con test/useObservable.test.tsx, especialmente con emits the new observable's value if the observable is swapped out. Sigue el SuspenseSubject mencionado, la caché preloadedObservables y la ruta de use-sync-external-store. La tarea estará terminada cuando el test vuelva a ser un it simple y pase con React 19, manteniendo el comportamiento de React 18.

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

Descripción

v5

useObservable in suspense mode suspends correctly when the observable and observableId are swapped, then resumes rendering the previous observable's value.

Found by the first test run ever executed against React 19 (#789); nothing had run against 19 before, only type-checks.

Reproduction

test/useObservable.test.tsx, emits the new observable's value if the observable is swapped out. The test renders a component under React.Suspense, emits Jeff on the first observable, swaps both the observable and the observableId, rerenders, then emits James on the second.

  • React 18.2.0: the fallback shows, then the component resumes with James. Passes.
  • React 19.2.8: the fallback shows (that assertion passes), then the component resumes with Jeff. Fails.

Deterministic: 3 runs each way, same @testing-library/react 16.3.2, only the React runtime swapped via npm install --no-save react@19 react-dom@19. No emulators involved, so npx vitest run useObservable reproduces it.

What is known and not known

  • The suspend half works. Only the resume is wrong, so this is not the known throw-vs-use() question: the 08-07 spike found the use() swap is a behavioural no-op on 19 and that React 19 emits no warning for the current throw form. Nothing here contradicts that.
  • The cause is not diagnosed. The plumbing involved (SuspenseSubject, the preloadedObservables cache keyed by observableId, and the use-sync-external-store shim delegating to React's own useSyncExternalStore on 19) overlaps what #790 covers, but no connection has been established and it should not be assumed.

Current state

#789's CI PR skips this test on React 19 only, so the new test job can land green. The skip is a ? it.skip : it ternary rather than it.skipIf, because these globals are typed by @types/jest and skipIf fails tsc while working at runtime.

Restore it to a plain it when this is fixed.

Lenguaje dominante
TypeScript
Estrellas
3.6k
Forks
403
Merge medio
5 d 1 h
PR fusionados (30 d)
10

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 FirebaseExtended/reactfire

Todos los issues de FirebaseExtended/reactfire

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.