diff --git a/src/index.ts b/src/index.ts index 21d1350..78d5969 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,8 +118,8 @@ function useResizeObserver( const reportedWidth = extractSize(entry, boxProp, "inlineSize"); const reportedHeight = extractSize(entry, boxProp, "blockSize"); - const newWidth = reportedWidth ? round(reportedWidth) : undefined; - const newHeight = reportedHeight + const newWidth = reportedWidth != null ? round(reportedWidth) : undefined; + const newHeight = reportedHeight != null ? round(reportedHeight) : undefined;