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

Feature: specify default width/height for withParentSize from @visx/responsive #554

Closed
SleepWalker opened this issue Nov 1, 2019 · 2 comments · Fixed by #836
Closed

Comments

@SleepWalker
Copy link

Hello, I would like to suggest to add a way to specify default width/height for withParentSize enahncer from @fx/repsponsive.

e.g.:

export default withParentSize(Component, {
  initialHeight: 400,
  initialWidth: 400,
});

This will help to avoid layout shifting during component mounting.

As alternative we can add another property e.g. parentSizeMeasured (or a way to render placeholder in place of original Component) to allow Component to provide stub view, till we get actual size.

If this feature will be accepted, I can prepare PR

@williaster
Copy link
Collaborator

hey @SleepWalker sorry for the very delayed response, this seems like a reasonable feature! happy to review a PR 😄

@shannonrothe
Copy link
Contributor

@williaster Added a PR for these props here. First time contributing but let me know if I'm missing anything!

@williaster williaster changed the title Feature: specify default width/height for withParentSize from @fx/responsive Feature: specify default width/height for withParentSize from @visx/responsive Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants