Stale useEffectEvent closures under memo()/forwardRef() on React 19.2 in UnitGrid, Modal, NotificationStack and modalStack
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 0
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 36
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lablup/ui-common のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
Stat: add a tooltip that explains the delta対応中かも @agatha197 が 2 日前に担当しました。 オープン
lablup/ui-common#110 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
lablup/ui-common の issue をすべて見る
似ている issue
-
area:cli bug P4
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
esengine/DeepSeek-Reasonix#14868 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
linxiv-dev/linXiv#384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信