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).

Trending on Indie Hackers
Getting first 908 Paid Signups by Spending $353 ONLY. 24 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 12 comments Hero Section Copywriting Framework that Converts 3x 12 comments Join our AI video tool demo, get a cool video back! 12 comments