3
0 Comments

React hook for getting the current window size

Here's a simple React hook that will give you the current window size. By initializing the width/height values as undefined and then updating state in useEffect we ensure that the hook can be used within server-rendered apps (which won't have a window object on server-render).

posted to
React
on October 16, 2020
Trending on Indie Hackers
I've built a 2300$ a month SaaS out of a simple problem. 19 comments 🔥 Roast My Landing Page 12 comments Where can I buy newsletter ad promos? 8 comments Key takeaways growing MRR from $6.5k to $20k for my design studio 6 comments How would you monetize my project colorsandfonts? 5 comments YouTube? How to start 5 comments