Stale useEffectEvent closures under memo()/forwardRef() on React 19.2 in UnitGrid, Modal, NotificationStack and modalStack
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Start in the hooks layer and inspect the four callers named in the issue: UnitGrid, Modal, NotificationStack, and modalStack. Reproduce the stale closure behavior under memo() and forwardRef() using the installed React version, then evaluate a shared latest-closure hook against the existing Form.useWatch fix in #121. Done means all four callers use the fix or have a documented reason their frozen closure is harmless, with a regression test; changing the React floor also requires a team decision and a CHANGELOG entry.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why
React 19.2.x republishes a useEffectEvent implementation only for plain function-component fibers; inside a memo() (without a compare function) or forwardRef() component the callback keeps its first render's closure for the component's whole life (facebook/react#34818, fixed in React 19.3 by facebook/react#34831). ui-common's peerDependencies still allow react ^19.2.0, so any consumer that wraps one of our components in memo() / forwardRef() on 19.2 gets frozen callbacks.
#121 fixed Form.useWatch by reading its latest path, selector, form and last value through a ref updated in useLayoutEffect instead of relying on useEffectEvent. The review of that PR found the same pattern in four other places, left unchanged there:
UnitGrid—refreshResolvedkeeps the first render'sdistinctColorsModal—notifyOpenChangekeeps the firstafterOpenChangecallbackNotificationStack—fireClosemodalStack—readZIndex
Scope
- One shared
useEvent-style hook (stable identity, latest closure through a ref assigned inuseLayoutEffect) in the hooks layer, with a test that exercises it undermemo()andforwardRef()on the installed React. - Replace the four
useEffectEventcallers with it (or document per site why the frozen closure is harmless there). - Alternatively, or in addition, raise the peer and dev React floor to
^19.3.0and record that in CHANGELOG — a team decision, since it drops 19.2 consumers.
Found during the review of #121; consumer context in lablup/backend.ai-webui#10705.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 0
- Merge medio
- 1g 13h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 lablup/ui-common
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lablup/ui-common
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
excaliburjs/Excalibur#3895 ·
I maintainer di solito rispondono entro 3 giorni
-
infer_audio_type only recognises one MPEG Layer III frame header, so most MP3 files are rejectedForse già presa @Steve-20-ai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Earn report crashes with "RangeError: Invalid time value" when a report row has an unparsable timestampForse già presa @Gurkaran18 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
joinmarket-webui/jam#1588 ·
I maintainer di solito rispondono entro 3 giorni
-
BeOS .json missingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mihaip/infinite-mac#475 ·