mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-09 18:13:39 +00:00
fix(use-window-size): default value
This commit is contained in:
parent
0dc78ef076
commit
cfa34de8cc
@ -1,10 +1,13 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
export const useWindowSize = () => {
|
||||
const [size, setSize] = useState({ width: 0, height: 0 })
|
||||
const [size, setSize] = useState({
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
function handleResize() {
|
||||
const handleResize = () => {
|
||||
setSize({
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
|
Loading…
x
Reference in New Issue
Block a user