Skip to content

Commit

Permalink
ウィンドウのリサイズイベントリスナーを削除するためのクリーンアップ関数を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun-Murakami committed May 4, 2024
1 parent 62cf5eb commit 9af19a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/SortableTree/SortableTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function SortableTree({ collapsible, indicator = false, indentationWidth

// コンポーネントのアンマウント時にイベントリスナーを削除
return () => window.removeEventListener('resize', handleResize);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const measuring = {
Expand Down

0 comments on commit 9af19a7

Please sign in to comment.