-
Notifications
You must be signed in to change notification settings - Fork 10
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
Change default value of 'values' prop #30
Conversation
Should add - this is only necessary because the media state is copied in to a member field in the constructor. This member field is then used and updated in |
had a chat offline - will wait for the other fix for this :) |
Hello, just curious, can you share what the "other fix" is, if not a secret? :) |
Thanks for the reply. Though it seems that it's been a while since this conversation has started. I think this package is very nice and I would like to see this bug fixed asap so I will try to make a pull request soon with an attempt to clean the code myself; hoping that you'll like it. |
I think the simplest solution for now is to update |
And I now realise that this is exactly what you proposed @gwn, so I think we're all on the same page now! |
@xanido a unit test and we should be good to go :) |
For those outside of Domain, this caused an issue on the first Regarding the duplication of |
Happy to see this merged. Thanks :) |
If a consumer doesn't pass
values
the component should match queries usingwindow.matchMedia
on initialisation, if available. However, because the default value ofvalues
prop is{}
, which is truthy, the component tries to match against an empty object instead.Conditional check is here: https://github.com/xanido/react-media-query-hoc/blob/b86628/src/media-query-provider.js#L21