Package Exports
- use-window-dimensions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-window-dimensions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Hook use-window-dimensions
Um hook para receber, em tempo real, os tamanhos horizontal e vertical da tela.
Instalação
- npm:
npm install use-window-dimensions
- yarn:
yarn add use-window-dimensions
Como usar
import React from 'react';
import useWindowDimension from 'use-window-dimensions';
const Component: React.FC = () => {
const { width, height } = useWindowDimensions();
console.log("width: " + width + "height: " + height);
return (
<div>
<h1>Height: {width} | Width: {height}</h1>
</div>
);
}