Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-classes

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-classes

A small wrapper and mixin for the React class addon

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34
decreased by-50.72%
Maintainers
1
Weekly downloads
 
Created
Source

react-classes npm version Dependency Status

A small wrapper for React.addons.classSet

WARNING: This module is no longer actively maintained. As of React version 0.13.0, React.addons.classSet is deprecated and as of React version 0.14.0, addons are no longer a part of the React core. I would reccommend using the classnames module instead.

Overview

This module adds additional functionality to class name manipulation in React by allowing a base class to be specified.

Example

This component will always be rendered with base class of .foo and will have the classes of .bar & .baz when the expressions are true.

render: function() {

  var classes = this.getClass('foo', {
    'bar': this.props.bar === true,
    'baz': this.props.baz === true
  });

  return (
    <div className={classes}></div>
  );

}

Quick Start

Install with npm:

npm install react-classes --save

Require the module in your project and add it to the React component as a mixin.

/** @jsx React.DOM */

var React = require('react');
var classes = require('react-classes');

module.exports = React.CreateClass({

  mixins: [classes],


Built with care in New Orleans by Patrick Burtchaell.

Copyright 2014 Patrick Burtchaell. All rights reserved.

Keywords

FAQs

Package last updated on 19 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc