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

Resize not being detected when rendering component is changed (HOC). #101

Closed
misaelgaray opened this issue Sep 2, 2020 · 7 comments
Closed

Comments

@misaelgaray
Copy link

misaelgaray commented Sep 2, 2020

When rendering multiple components it just detects resizing in the first one. If, for some reason, you start rendering another one, it just not detects the resizing in the second one. This happens using HOC. Example.
render(){ if(!this.state.show){ return <button onClick={this.handleShow}>Show</button> } return <h1>Hey there</h1>; }

@maslianok
Copy link
Owner

Yes, you're right.

It happens because resize-detector caches the element on the first render in componentDidMount.

@maslianok
Copy link
Owner

Fixed in v.5.1.0

Please upgrade to the last version from npm

@zarv1k
Copy link

zarv1k commented Sep 3, 2020

@maslianok could you please remove console logs?

@maslianok
Copy link
Owner

lol :) done

@zarv1k
Copy link

zarv1k commented Sep 3, 2020

@maslianok it seems that console logs still live in lib (build results) :). Could you please rebuild and publish version without logs?

@maslianok
Copy link
Owner

maslianok commented Sep 3, 2020

@zarv1k omg, sorry for the inconvenience :(

That's how it works when you're rushing...

Fixed in v5.1.3 (I hope)

@zarv1k
Copy link

zarv1k commented Sep 3, 2020

@maslianok it happens :) Thank you!

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