react-classie

0.0.1 • Public • Published

react-classie

NPM version Build Status Dependency Status

A CSS class management mixin for react based on React.addons.classSet

Install

$ npm install --save react-classie

Usage

The API is still clunky now especially in the initialization part but that should be addressed in the next releases.

var React = require('react'),
    reactClassie = require('react-classie');
 
var Component = React.createClass({
  mixins:[reactClassie],
  getInitialState: function(){
    state = {
      _cs:{
        component: this.getEmptyClassState('component')
      }
    }
    return state;
  },
  clickHandler: function(){
   this.toggleClassName('active', this._cs.component);
  },
  render: function(){
    return <div className={this.classesFor('component')} onClick={this.clickHandler}/>
  }
});
 

API

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

Release History

(Nothing yet)

License

Copyright (c) 2014. Licensed under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i react-classie

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • sudoguru