Skip to content
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: InputFileの内部処理をリファクタリングする #5283

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

AtsushiM
Copy link
Member

関連URL

概要

変更内容

確認方法

@yagimushi yagimushi force-pushed the chore-refactoring-InputFile branch from b5503a0 to 635feb2 Compare January 15, 2025 02:58
Copy link

pkg-pr-new bot commented Jan 15, 2025

Open in Stackblitz

npm i https://pkg.pr.new/kufu/smarthr-ui@5283

commit: 635feb2

@AtsushiM AtsushiM changed the title Chore refactoring input file chore: InputFileの内部処理をリファクタリングする Jan 15, 2025
Comment on lines +155 to +160
(e: React.MouseEvent<HTMLButtonElement>) => {
if (!inputRef.current) {
return
}

const index = parseInt(e.currentTarget.value, 10)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button要素のvalueを参照するように変更することで、handleDeleteが再作成される可能性を激減させました。
ほぼ再作成されなくなると思われます

Comment on lines +218 to +228
const StyledFaFolderOpenIcon = React.memo<{ className: string }>(({ className }) => (
<span className={className}>
<FaFolderOpenIcon />
</span>
))

const LabelRender = React.memo<{ id: string; label: ReactNode }>(({ id, label }) => (
<span id={id} aria-hidden="true">
{label}
</span>
))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほぼ固定されたUIのためmemo化しました

@AtsushiM AtsushiM marked this pull request as ready for review January 15, 2025 03:29
@AtsushiM AtsushiM requested a review from a team as a code owner January 15, 2025 03:29
@AtsushiM AtsushiM requested review from nabeliwo and yuzuru-akiyama and removed request for a team January 15, 2025 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant