-
Notifications
You must be signed in to change notification settings - Fork 715
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
fix(vx-responsive): fix enhancer parent/screen size checks #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking. Just ask whether 0
width
or height
should be rendered?
> | ||
{parentWidth !== null && parentHeight !== null && ( | ||
<div style={CONTAINER_STYLES} ref={this.setRef}> | ||
{parentWidth != null && parentHeight != null && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to check for 0
as well?
@@ -54,7 +54,7 @@ export default function withScreenSize<BaseComponentProps extends WithScreenSize | |||
|
|||
render() { | |||
const { screenWidth, screenHeight } = this.state; | |||
if (!screenWidth && !screenHeight) return null; | |||
if (screenWidth == null || screenHeight == null) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to check for 0
as well?
hmm 🤔 if it is I think it's okay for us to pass |
Also noting that rendering with |
🐛 Bug Fix
Fixes #619 where the TS re-write introduced a regression wherein the state is initialized with
undefined
, while the render method checks fornull
s@hshoff @kristw
cc @dson