-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: SingleComboBoxの内部ロジックを整理する #5337
base: master
Are you sure you want to change the base?
Conversation
…e-add-use-decorators
@@ -59,42 +59,37 @@ const ListBoxItemButton = <T,>({ | |||
const buttonStyle = useMemo( | |||
() => | |||
button({ | |||
active: !!isActive, | |||
active: isActive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isActiveは常にbooleanなので !!
でboolean化する必要はありません
{label} | ||
</button> | ||
) | ||
} | ||
|
||
const MemoizedNewIconWithText = React.memo<{ label: ReactNode }>(({ label }) => ( | ||
<FaPlusCircleIcon color="TEXT_LINK" text={<Text color="TEXT_LINK">「{label}」を追加</Text>} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icon自体はmemo化されていますが、textにReact.Componentが渡されれば毎回再レンダリングされてしまいます。
幸いlabelが切り替わる可能性がないため、Icon毎Textを含めた状態でmemo化するようにしました
833cfa2
to
15701b3
Compare
commit: |
15701b3
to
549eec5
Compare
関連URL
概要
変更内容
確認方法