setState should clearly error within useAsync
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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/
- Lingua principale
- TypeScript
- Stelle
- 210
- Fork
- 88
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reddit/devvit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
Tutte le issue di reddit/devvit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
copse-dev/agent-pane#2953 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·