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

refreshMode: 'debounce' delays first render significantly. #99

Closed
nomcopter opened this issue Sep 13, 2016 · 5 comments
Closed

refreshMode: 'debounce' delays first render significantly. #99

nomcopter opened this issue Sep 13, 2016 · 5 comments

Comments

@nomcopter
Copy link

It should not wait to read the size from the DOM for the first render.

@ctrlplusb
Copy link
Owner

ctrlplusb commented Sep 13, 2016

You can disable the placeholder render feature by setting the global flag:

import sizeMe from 'react-sizeme';
sizeMe.enableSSRBehaviour = true;

That's a good caveat you caught in regards to switching out to debounce. I'll have to amend the docs.

@ctrlplusb
Copy link
Owner

I am also going to consider creating an alias to the above property. Something like enablePlaceholderRender...

Will give it some thought.

@nomcopter
Copy link
Author

Hmm, could work. Is that better than explicitly checking the size and bypassing refreshDelayStrategy on the first render?

@ctrlplusb
Copy link
Owner

I am going to give this one some thought and some time to simmer. I have a use case in my own project for the use of debounce so I'll get a first hand sense of the issues around the current implementation. I may need to consider some further configuration options, but definitely want to try and keep things as simple as possible.

@nomcopter
Copy link
Author

The workaround is working well for me, thanks for the quick response!

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

2 participants