setState should clearly error within useAsync

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
frontend

Línea de trabajo

Start by locating the useAsync entry point and reviewing the documentation that currently warns about state use inside data-fetch functions. Trace how setState calls are handled there and identify the existing tests for useAsync behavior. Done means an in-scope setState call produces a clear error rather than being silently ignored, with the documentation updated if needed.

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

Descripción

blocks

It appears that set state calls inside of useAsync data fetch functions are silently ignored.

Issues with using state inside of the useAsync function are mentioned in the docs, but it is clearly not visible enough, as many devs have unknowingly ran into this issue.

I think the best solution would be to throw an error if a set state function is called in useAsync.

Reddit thread regarding this: https://www.reddit.com/r/Devvit/comments/1jrjtp6/blocks_psa_dont_use_setstate_within_useasync/

Lenguaje dominante
TypeScript
Estrellas
210
Forks
88
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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 reddit/devvit

Todos los issues de reddit/devvit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.