how to only render a element on mobile view code example Example: reactjs javascript is mobile and desktop const detectMobile = ()=> window.innerWidth < 768;