2.0.0 • Published 9 years ago

react-component-width-mixin v2.0.0

Weekly downloads
199
License
MIT
Repository
github
Last release
9 years ago

react-component-width-mixin

React mixin which detects when component resizes and sets the new width as a state variable

Install

npm install react-component-width-mixin

Usage

var componentWidthMixin = require('react-component-width-mixin');

React.createClass({
  mixins: [componentWidthMixin],
  
  render: function() {
    // Now the component width is available after the initial render
    // as this.state.componentWidth.
  }
});

If you'd like to set an initial width for your component (e.g. server-side rendering), pass in a prop called initialComponentWidth.

2.0.0

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago