Incorrect sentence in `useSyncExternalStore`
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
The documentation of the subscribe argument of useSyncExternalStore states the following (emphasis mine):
subscribe: A function that takes a single callback argument and subscribes it to the store. When the store changes, it should invoke the provided callback. This will cause the component to re-render. The subscribe function should return a function that cleans up the subscription.
As far as I understand, it is not correct that invoking the callback will cause the component to re-render, it is only if the snapshot also changed that the component will re-render. Otherwise it would make a library like Redux unusable if every connected component re-rendered at every store change.
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
Comienza por la sección de la documentación de React sobre el argumento subscribe de useSyncExternalStore y verifica el comportamiento del callback y del snapshot descrito en el issue. Actualiza la frase inexacta para que refleje que un nuevo renderizado depende de que cambie el snapshot; se considera terminado cuando la documentación ya no afirma que cada invocación del callback vuelve a renderizar el componente.
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
- 45/100