This react typescript hook will work in tandem with your tailwind config. You can also remove the tailwind references to make it work without.
It is recommended to place this in a folder like hooks/use-breakpoint.ts
or src/hooks/use-breakpoint
, or next to any other hooks you have defined.