react-component-width-mixin
React mixin which detects when component resizes and sets the new width as a state variable
Last updated 9 years ago by kylemathews .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install react-component-width-mixin 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 2.0.0                                ...           latest (9 years ago)

16 Versions

  • 2.0.0                                ...           9 years ago
  • 1.1.8                                ...           10 years ago
  • 1.1.7                                ...           10 years ago
  • 1.1.6                                ...           10 years ago
  • 1.1.5                                ...           10 years ago
  • 1.1.4                                ...           10 years ago
  • 1.1.3                                ...           10 years ago
  • 1.1.2                                ...           10 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
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE