-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Uses "useResponsiveQuery" hook over "withPlaceholder" in Only component #310
Conversation
0e65a49
to
3e4c173
Compare
Hi, @Vidlec. Could you please get a look at this pull request? It should fix the issue you are experiencing. Thank you! |
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.
This looks amazing!
// Render always when no constrains are provided | ||
return <>children</> | ||
const matches = useResponsiveQuery({ for: exactBreakpoint, from, to, except }) | ||
return matches && <Box {...restProps}>{children}</Box> |
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.
Instead of rendering in a fragment and deligating the restProps
assignment to the withPlaceholder
(MediaQuery
, effectively), the Only
component now renders a Box, to which it assigns all the passed box props. This should not introduce any breaking changes, as it's a matter of moving the abstracted parent component up to the application surface.
Changes
Issues
Release version
Contributor's checklist
master
yarn verify
to see the build and tests pass