Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with contentRect.bounds #137

Closed
sherwinski opened this issue Apr 16, 2019 · 4 comments
Closed

Issue with contentRect.bounds #137

sherwinski opened this issue Apr 16, 2019 · 4 comments

Comments

@sherwinski
Copy link

Hi, we're using react-measure to determine the size of an image we want to render. It seems that after updating to the latest release (v2.2.6), contentRect.bounds.width and contentRect.bounds.height are consistently returning 0, which prevents our component from loading.

Here is a comparison showing the component using v2.2.6 versus v2.2.5. And some additional context on how we're using contentRect.

Is this intended behavior or possibly a regression introduced by changes in the last release? Any advice would be appreciated. Thanks!

@souporserious
Copy link
Owner

Ah, sorry about that! It looks like a regression from here 😞. I'll work on getting a fix together. Just want to make sure you aren't relying on onResize and only what comes back in the child function?

@sherwinski
Copy link
Author

Thanks for quick response! And yes I believe that is correct.

@michal-murawski
Copy link

michal-murawski commented Apr 17, 2019

I was about to post the same issue. No reaction on initial render, but the data is passed properly to bounds when the windows size changes. After downgrade to 2.2.4 works.

We do not use onResize and simply just render <Measure> and use ref={measureRef} with contentReact for different components

@souporserious
Copy link
Owner

Should be fixed under 2.3.0 🤞. Thanks for letting me know about the issue and please feel free to reopen if you see any similar problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants