How to use the @rooks/use-window-size function in @rooks/use-window-size

To help you get started, we’ve selected a few @rooks/use-window-size examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imbhargav5 / rooks / packages / storybook / src / window-size.js View on Github external
function WindowComponent() {
  const { innerWidth, innerHeight, outerHeight, outerWidth } = useWindowSize();

  return (
    <>
      <h1> Window dimensions</h1>
      <h3>Resize window to see changes</h3>
      <div>
        <p>
          <span>innerHeight - </span>
          <span>{innerHeight}</span>
        </p>
        <p>
          <span>innerWidth - </span>
          <span>{innerWidth}</span>
        </p>
        <p>
          <span>outerHeight - </span></p></div>

@rooks/use-window-size

A React Hooks package for window-size

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis

Popular @rooks/use-window-size functions