useBreakpoint Hook — Get Media Query Breakpoints in React

Creating a custom Hook to get window widths or breakpoints

Udit Tyagi
Better Programming
Published in
4 min readOct 1, 2019

--

Photo by Mikael Kristenson on Unsplash

You can easily choose your UI design based on viewport width in CSS using media queries, but sometimes you need to get the window width or breakpoints to adjust your UI as per the viewport width in React.

--

--