Align useResizeObserver
with EuiResizeObserver
component behavior
#7458
Labels
feature request
good first issue
low hanging fruit
An issue, often a bug, that is lower effort and clearly ought to be fixed
Describe the bug
I'm not sure if this is a bug, but the discrepancy can be seen on the docs page.
Both
EuiResizeObserver
anduseResizeObserver
give initial container dimensions, but they are always[0, 0]
foruseResizeObserver
.correct initial dimensions
incorrect initial dimensions
Impact and severity
This isn't directly impacting an end user. There is a workaround—get the initial size from the
ref
in auseEffect
hook. It works, but it would be much nicer to just have to worry about a single hook:useResizeObserver
.Environment and versions
To Reproduce
Look at the initial values show in the docs page.
Expected behavior
As soon as the
ref
is populated,useResizeObserver
should return its initial dimensions.The text was updated successfully, but these errors were encountered: