JSPM

use-window-dimensions

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q48034F
  • License MIT

Função para obter os tamanhos atuais da tela.

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>
  );
}