Skip to content

tiaanduplessis/react-resize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@tiaanduplessis/react-resize

package version package downloads standard-readme compliant package license make a pull request

Little resize listener component

Table of Contents

Usage

import React from 'react'
import Resize, {Breakpoint} from '@tiaanduplessis/react-resize'

const Example = () => {
  return <main>
    <Resize>{
      ({ width, height }) => <div>{width} - {height}</div>
    }</Resize>

    <Breakpoint minWidth={500}>
      <h1>Hi</h1>
    </Breakpoint>

  </main>
}

export default Example

Install

This project uses node and npm.

$ npm install @tiaanduplessis/react-resize
$ # OR
$ yarn add @tiaanduplessis/react-resize

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT © Tiaan du Plessis

About

Little resize listener component

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published