flexdinesh / react-socks

🎉 React library to render components only on specific viewports 🔥
MIT License
426 stars 29 forks source link

Accessing current width and current breakpoint name #17

Closed Entkenntnis closed 5 years ago

Entkenntnis commented 5 years ago

Sometimes it's useful to access context variables directly, e.g. if you want to write your own logic (in conjunction with react-socks).

Implementing it with react hooks is quite straight forward, here is a PR.

pgegenfurtner commented 5 years ago

@flexdinesh When will you merge this? Need this feature 😊

flexdinesh commented 5 years ago

@pgegenfurtner I haven't gotten to this yet. But I will definitely get this done this week. Should be available from npm next week I promise :)

Gotta run a few tests against hooks and see how it's fairing and will release it as a new version.

flexdinesh commented 5 years ago

This is a breaking change. Will have to upgrade peer dependency to a React version that supports hooks and should do a major version bump. I'll get this done this week.

flexdinesh commented 5 years ago

Changes released with v2.0.0. Thank you!