Open vineetit1991 opened 5 years ago
Ah, sorry I should have made this more clear in the 2.3.0
release that this could be a breaking change. It would probably be best to just bail out of onResize
if no measurements were found on mount.
This should fix the issue for now:
<Measure
onResize={({ entry }) => entry && dispatch({
type: XXXX_XXXXX,
payload: {
width: Math.ceil(entry.width),
height: Math.ceil(entry.height)
}
})}
>
I'll think about a better solution here. Do you think the existence of entry
is enough? The unfortunate part is it needs to fire onResize
both in componentDidMount
and the resize observer, that's why there are two calls to onResize
on initial render 😞.
Error:- Uncaught TypeError: Cannot read property 'width' of undefined
Version:- 2.3.0