[Bug]:Possible wrong descrption for useDeferredValue
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 11.8k
- Forks
- 7.9k
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 11
Descripción
Summary
The doucmention describe the wrong behaviour for useDeferredValue
Page
https://react.dev/reference/react/Suspense
Details
The documentation says:
The query will update immediately, so the input will display the new value. However, the deferredQuery will keep its previous value until the data has loaded
From my test, deferredQuery also updates immediately rather than waiting for the data to be loaded here is the link https://codesandbox.io/p/sandbox/react-dev-forked-kxfktt
useDeferredValue consistently lags query with around 4 or 5 ms
Think about it, if deferredQuery updates after SearchResults is ready, how SearchResults receive the latest data at the first place?
The real reason we can see opacity: 0.2 for several seconds is that the new content is not rendered yet; rather than
the deferredQuery will keep its previous value until the data has loaded
If my understanding is correct, I should say the documentation is misleading, especially for the newbies
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Lee el pasaje sobre useDeferredValue en https://react.dev/reference/react/Suspense y reproduce el comportamiento en el CodeSandbox enlazado. Compara la redacción sobre deferredQuery con los tiempos observados y, después, actualiza la documentación para que explique con precisión cuándo cambia el valor y qué indica la opacidad.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- react
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100