Repository navigation
fix: preact v11 で MutableRef が無くなったことに対応する - #106
Merged
Merged
Conversation
preact v11 の preact/hooks は MutableRef をエクスポートしなくなり、 useRef が返す型も preact の RefObject<T> に変わった。該当箇所を RefObject に置き換える。 また、useRef<T>(null) の返り値の型が RefObject<T | null> に厳密化されたのに伴い、 useDragReorder・useStepWithFocus(rule-list.tsx)が受け取る listRef の型を null を許容する RefObject<HTMLOListElement | null> に広げる(実装側はすでに null を考慮していた)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
PR #103(preact を v11 に更新)で、preact v11 の型定義の破壊的変更により CI(型チェック)が失敗していたための修正。
関連Issue
なし(PR #103 のCI失敗修正)
関連ADR
なし
変更内容
preact/hooksからMutableRef型がエクスポートされなくなったため、components/rule-settings/use-rules.ts・use-rules.test.tsで使っていた箇所をpreactのRefObjectに置き換えるuseRef<T>(null)の返り値の型がRefObject<T | null>に厳密化されたのに伴い、useDragReorder(use-drag-reorder.ts)・useStepWithFocus(rule-list.tsx)が受け取るlistRefの型をRefObject<HTMLOListElement | null>に広げる(実装側はすでにcurrentがnullの場合を考慮済み)確認方法
pnpm typecheck・pnpm lint・pnpm fmt:check・pnpm test(309件)が通ることを確認済みnix develop .#e2e --command pnpm e2eで E2E テストが通ることを確認済み(auto-grouping.e2e.tsの1件は並列実行時のみ再現する既知のflakyなテストで、単独実行・再実行では成功する。PR #103自体には無関係)prek runが通ることを確認済みチェックリスト
nix flake checkとprek run --all-filesが通るdocs/adr/に ADR を追加した(今回は ADR 不要)🤖 Generated with Claude Code