reactjs / reactjs/react.dev

The following two paragraphs in "Splitting High and Low Priority State" in Concurrent UI Patterns creates confusion

Abierto
#2,715 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

When you design React components, it is usually best to find the “minimal representation” of state. For example, instead of keeping firstName, lastName, and fullName in state, it’s usually better keep only firstName and lastName, and then calculate fullName during rendering. This lets us avoid mistakes where we update one state but forget the other state.

However, in Concurrent Mode there are cases where you might want to “duplicate” some data in different state variables.

Isn't this how we build React apps anyways -- we store query value in a one state and data in another state? I am asking this because the description at the beginning of this section does not provide relevant information for the rest of the section, which mainly talks about moving setResource to startTransition to make it "low priority". In contrary, it creates a confusion that putting input value and API data in the same state was a normal occurrence. Even in the provided example, we are not really duplicating data -- we are just using each data in a different way (one in a normal way and another one inside startTransition).

If the idea of duplication is that resource and state coexist as a duplicate data, I think that also contradicts all the previous sections on this page because we have been storing "concurrent resource" in the state for "profile change" example etc.

I suggest that we remove these bits and replace it with something like:

In the past, when designing React components, we would handle input state and data state within the same application flow using React's state management. However, existing flow cannot be applied when data is being handled using concurrent mode APIs. Consider this tiny translation app:

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.

Línea de trabajo

Localiza la sección “Splitting High and Low Priority State” en la documentación de React y lee el contenido circundante de Concurrent UI Patterns. Sustituye los párrafos introductorios confusos por una redacción que coincida con el ejemplo de input state, data state y startTransition; el trabajo estará terminado cuando la explicación de la sección sea coherente con el ejemplo y las secciones anteriores.

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
Estancado
Claridad
Bien especificado
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.