Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get window size in react js

const Component = () => {
  const { height, width } = useWindowDimensions();

  return (
    <div>
      width: {width} ~ height: {height}
    </div>
  );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #window #size #react #js
ADD COMMENT
Topic
Name
3+3 =