Skip to content

Commit 3211d33

Browse files
committed
fix: Removed unnecessary entries.length check
Looking at the RO spec, it can never be empty. https://www.w3.org/TR/resize-observer/#broadcast-resize-notifications-h
1 parent 599cace commit 3211d33

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ function useResizeObserver<T extends HTMLElement>(
137137
return;
138138
}
139139

140-
// Since we only observe the one element, we don't need to loop over the
141-
// array
142-
if (!entries.length) {
143-
return;
144-
}
145-
146140
const entry = entries[0];
147141

148142
// `Math.round` is in line with how CSS resolves sub-pixel values

0 commit comments

Comments
 (0)