0.0.1 • Published 10 years ago

react-classie v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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.