diff --git a/src/App.js b/src/App.js index 35280e9..dc2de8b 100644 --- a/src/App.js +++ b/src/App.js @@ -8,7 +8,7 @@ import { ReactComponent as ChevronIcon } from './icons/chevron.svg'; import { ReactComponent as ArrowIcon } from './icons/arrow.svg'; import { ReactComponent as BoltIcon } from './icons/bolt.svg'; -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect } from 'react'; import { CSSTransition } from 'react-transition-group'; function App() { @@ -49,12 +49,7 @@ function NavItem(props) { function DropdownMenu() { const [activeMenu, setActiveMenu] = useState('main'); - const [menuHeight, setMenuHeight] = useState(null); - const dropdownRef = useRef(null); - - useEffect(() => { - setMenuHeight(dropdownRef.current?.firstChild.offsetHeight) - }, []) + const [menuHeight, setMenuHeight] = useState('auto'); function calcHeight(el) { const height = el.offsetHeight; @@ -72,7 +67,7 @@ function DropdownMenu() { } return ( -
+