// import { useState } from 'react' import Res from './responsiveMenu/Res' import NormalWidth from './navNormalwidth/NormalWidth'
const Navbar=()=>{ const [click,setClick]=useState(true)
// function to change from true to false const navBtn=()=>{setClick(!click)}
const screenwidth=window.innerWidth
return(
<>
{screenwidth<'640' ? <Res btnF={navBtn} click={click}/>:screenwidth>'640'?<NormalWidth/>:''}
</>
)
}
export default Navbar
why when the screen is 640 is works but when i make it bigger i the menu btn stays until i press it then it will render the normal component