[Suggestion]: Add a note about the `use` API as an alternative to `useEffect`
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 section on the useEffect page about good alternative to fetching data is a great resource, but does not mention the use API at all. I recommend adding some text to clarify the existence of this option and any pros/cons.
Page
https://react.dev/reference/react/useEffect#what-are-good-alternatives-to-data-fetching-in-effects
Details
It is unclear from the documentation what the relationship between useEffect and use is. The useEffect page does not mention the use API at all, and neither does the use page. The useEffect page contains a section called “Fetching data with Effects”, and the use page contains a section called Streaming data from the server to the client. So, it sounds like both can be used for fetching data, but there is no acknowledgement of this or relevant guidance.
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
Empieza leyendo en la página de useEffect la sección «What are good alternatives to data fetching in Effects?» y en la página de use la sección «Streaming data from the server to the client». Aclara la relación entre useEffect y use, incluidos los compromisos relevantes, y actualiza la documentación para que los lectores puedan identificar cuándo se aplica cada enfoque.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, react
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100