read screen size in react functional component code example Example: react js get screen size console.log(window.innerHeight);