---
title: "Discussion on \"How to get the height of browser window in React ?\" | Hashnode"
description: "Discussion on \"How to get the height of browser window in React ?\". import \"./styles.css\";\n\nimport { useEffect, useState } from \"react\";\n\nexport default function App() {\n  const [windowHeight, setWindowHeight] = useState(window.innerHeight);\n\n  useEffect(() => {\n    const handleResize = () => {\n      setWindowHeight(..."
url: "https://hashnode.com/posts/how-to-get-the-height-of-browser-window-in-react/66bb732971f5f416777d9440"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to get the height of browser window in React ?](https://ranjans.hashnode.dev/how-to-get-the-height-of-browser-window-in-react?utm_source=hashnode&utm_medium=feed)

import "./styles.css"; import { useEffect, useState } from "react"; export default function App() { const \[windowHeight, setWindowHeight\] = useState(window.innerHeight); useEffect(() => { const handleResize = () => { setWindowHeight(...

Aug 13, 2024 · 1 min read · ranjans.hashnode.dev  
Read the article

## Written by

[ranjan](https://hashnode.com/@ranjanmehta)

@ranjanmehta

  
[View profile](https://hashnode.com/@ranjanmehta)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
