I wanted to ask if there is a smart way of querying the current breakpoint inside a component? I.e. to not render a sidebar tree that is anyhow never shown on mobile.
You probably want something like this https://github.com/ReactTraining/react-media
Yeah I wanted to avoid another dependency and see, if there’s already something exposed.
styled-system is much lower-level and doesn't involve the DOM or window object, so it doesn't really have anything like this. In a nutshell, styled-system is (propsObject) => styleObject – hope that makes sense!
Alright; I'll close this. At the end of the day, its a _simple_ call of window.matchMedia("(min-width: 400px)").matches (depending on browser support) and just wanted to double check to not miss an implementation on your side.
Anyway: Maybe needless to say, but I really love your libraries and thought process behind their architecture! Thank you very much for contributing your skill in that way to the open source domain.
Most helpful comment
Alright; I'll close this. At the end of the day, its a _simple_ call of
window.matchMedia("(min-width: 400px)").matches(depending on browser support) and just wanted to double check to not miss an implementation on your side.Anyway: Maybe needless to say, but I really love your libraries and thought process behind their architecture! Thank you very much for contributing your skill in that way to the open source domain.