Skip to content

fermdotnet/useWindowSize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A custom hook for react: useWindowSize

Demo (Codepen)

https://codepen.io/ferdotnet/pen/gOKKRJE

Install

yarn add @ferdotnet/use-window-size

How to use it?

import React from 'react';
import useWindowSize from '@ferdotnet/use-window-size';

export default () => {
    const { width, height } = useWindowSize(); 

    return <div>width: {width} height: {height}</div>;
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published