refactor(Pagination): onClickの依存配列問題を解決#6420
Draft
AtsushiM wants to merge 2 commits into
Draft
Conversation
onClickをrefに保存し、hrefTemplateをhasHrefTemplate(boolean)に変換することで、 依存配列を安定化 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
onClick が ButtonProps と AnchorProps で異なる型を持つため、 型アサーションを追加してTypeScriptエラーを解消 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
commit: |
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.
関連URL
なし
概要
ESLint ルール
smarthr/best-practice-for-unstable-dependenciesでonClickが依存配列に含まれることによるエラーを解消するため、onClickを ref に保存し、hrefTemplateを boolean に変換して依存配列を安定化しました。変更内容
Before
After
onClick(関数、unstable)を ref に保存hrefTemplate(関数、unstable)をhasHrefTemplate(boolean、stable)に変換[hasHrefTemplate]のみにプロダクト側で対応が必要な事項
なし
確認方法