From 6dfcf3688eea381578603634b22e8e700057ae25 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Wed, 8 Apr 2015 09:13:56 -0600 Subject: [PATCH] [changed] Internal variables classSet to classNames This has been causing a lot of confusion for folks since React has depricated `classSet`. We felt at the time that changing the require call to `require('classnames')` withing changing the variable name would be enough. It hasn't due to the confusion people are seeing. Fixes #489 --- docs/examples/.eslintrc | 2 +- docs/examples/CollapsableParagraph.js | 2 +- docs/src/ReactPlayground.js | 6 +++--- src/Affix.js | 4 ++-- src/Alert.js | 4 ++-- src/Badge.js | 4 ++-- src/Button.js | 8 ++++---- src/ButtonGroup.js | 4 ++-- src/ButtonToolbar.js | 4 ++-- src/Carousel.js | 4 ++-- src/CarouselItem.js | 4 ++-- src/Col.js | 4 ++-- src/CollapsableNav.js | 4 ++-- src/DropdownButton.js | 6 +++--- src/DropdownMenu.js | 4 ++-- src/FormGroup.js | 4 ++-- src/Glyphicon.js | 4 ++-- src/Grid.js | 4 ++-- src/Input.js | 18 +++++++++--------- src/Jumbotron.js | 4 ++-- src/Label.js | 4 ++-- src/ListGroup.js | 4 ++-- src/ListGroupItem.js | 8 ++++---- src/MenuItem.js | 4 ++-- src/Modal.js | 10 +++++----- src/Nav.js | 6 +++--- src/NavItem.js | 4 ++-- src/Navbar.js | 8 ++++---- src/PageHeader.js | 4 ++-- src/PageItem.js | 4 ++-- src/Pager.js | 4 ++-- src/Panel.js | 10 +++++----- src/PanelGroup.js | 4 ++-- src/Popover.js | 4 ++-- src/ProgressBar.js | 8 ++++---- src/Row.js | 4 ++-- src/SplitButton.js | 6 +++--- src/SubNav.js | 4 ++-- src/TabPane.js | 4 ++-- src/Table.js | 4 ++-- src/Tooltip.js | 4 ++-- src/Well.js | 4 ++-- test/CollapsableMixinSpec.js | 4 ++-- 43 files changed, 109 insertions(+), 109 deletions(-) diff --git a/docs/examples/.eslintrc b/docs/examples/.eslintrc index 558f5a24c4..2db814d319 100644 --- a/docs/examples/.eslintrc +++ b/docs/examples/.eslintrc @@ -6,7 +6,7 @@ "globals": { "mountNode", "React", - "classSet", + "classNames", "Accordion", "Alert", "Badge", diff --git a/docs/examples/CollapsableParagraph.js b/docs/examples/CollapsableParagraph.js index 8ab37508ef..9e45532e3b 100644 --- a/docs/examples/CollapsableParagraph.js +++ b/docs/examples/CollapsableParagraph.js @@ -20,7 +20,7 @@ const CollapsableParagraph = React.createClass({ return (
-
+
{this.props.children}
diff --git a/docs/src/ReactPlayground.js b/docs/src/ReactPlayground.js index b04caa6289..12294337e9 100644 --- a/docs/src/ReactPlayground.js +++ b/docs/src/ReactPlayground.js @@ -1,6 +1,6 @@ /* eslint-disable */ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import Accordion from '../../src/Accordion'; import Alert from '../../src/Alert'; import Badge from '../../src/Badge'; @@ -198,11 +198,11 @@ const ReactPlayground = React.createClass({ } return (
-
+
{editor} - {this.state.mode === this.MODES.NONE ? 'show code' : 'hide code'} + {this.state.mode === this.MODES.NONE ? 'show code' : 'hide code'}
); }, diff --git a/src/Affix.js b/src/Affix.js index 544245c978..0a902a5bfb 100644 --- a/src/Affix.js +++ b/src/Affix.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import AffixMixin from './AffixMixin'; import domUtils from './utils/domUtils'; @@ -15,7 +15,7 @@ const Affix = React.createClass({ return (
{this.props.children}
diff --git a/src/Alert.js b/src/Alert.js index bd28543cee..419b1e6613 100644 --- a/src/Alert.js +++ b/src/Alert.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; const Alert = React.createClass({ @@ -36,7 +36,7 @@ const Alert = React.createClass({ classes['alert-dismissable'] = isDismissable; return ( -
+
{isDismissable ? this.renderDismissButton() : null} {this.props.children}
diff --git a/src/Badge.js b/src/Badge.js index 06e027163e..910d6d3603 100644 --- a/src/Badge.js +++ b/src/Badge.js @@ -1,6 +1,6 @@ import React from 'react'; import ValidComponentChildren from './utils/ValidComponentChildren'; -import classSet from 'classnames'; +import classNames from 'classnames'; const Badge = React.createClass({ @@ -22,7 +22,7 @@ const Badge = React.createClass({ return ( + className={classNames(this.props.className, classes)}> {this.props.children} ); diff --git a/src/Button.js b/src/Button.js index d594f54486..27f1fa31e4 100644 --- a/src/Button.js +++ b/src/Button.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; const Button = React.createClass({ @@ -54,7 +54,7 @@ const Button = React.createClass({ {this.props.children} @@ -67,7 +67,7 @@ const Button = React.createClass({ return ( + className={classNames(this.props.className, classes)}> {this.props.children} ); @@ -79,7 +79,7 @@ const Button = React.createClass({ }; return ( -
  • +
  • {this.renderAnchor(classes)}
  • ); diff --git a/src/ButtonGroup.js b/src/ButtonGroup.js index 5e4f8c21a5..1492ae7bce 100644 --- a/src/ButtonGroup.js +++ b/src/ButtonGroup.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; const ButtonGroup = React.createClass({ @@ -25,7 +25,7 @@ const ButtonGroup = React.createClass({ return (
    + className={classNames(this.props.className, classes)}> {this.props.children}
    ); diff --git a/src/ButtonToolbar.js b/src/ButtonToolbar.js index b8b86e117f..e4dcb97473 100644 --- a/src/ButtonToolbar.js +++ b/src/ButtonToolbar.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; const ButtonToolbar = React.createClass({ @@ -18,7 +18,7 @@ const ButtonToolbar = React.createClass({
    + className={classNames(this.props.className, classes)}> {this.props.children}
    ); diff --git a/src/Carousel.js b/src/Carousel.js index 8084803986..458a5f65a4 100644 --- a/src/Carousel.js +++ b/src/Carousel.js @@ -1,5 +1,5 @@ import React, { cloneElement } from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; import ValidComponentChildren from './utils/ValidComponentChildren'; @@ -142,7 +142,7 @@ const Carousel = React.createClass({ return (
    {this.props.indicators ? this.renderIndicators() : null} diff --git a/src/CarouselItem.js b/src/CarouselItem.js index 0a76a3edfb..7ac5e6c5f3 100644 --- a/src/CarouselItem.js +++ b/src/CarouselItem.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import TransitionEvents from './utils/TransitionEvents'; const CarouselItem = React.createClass({ @@ -73,7 +73,7 @@ const CarouselItem = React.createClass({ } return ( -
    +
    {this.props.children} {this.props.caption ? this.renderCaption() : null}
    diff --git a/src/Col.js b/src/Col.js index 4155b04616..23ae471ad1 100644 --- a/src/Col.js +++ b/src/Col.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import constants from './constants'; const Col = React.createClass({ @@ -62,7 +62,7 @@ const Col = React.createClass({ }, this); return ( - + {this.props.children} ); diff --git a/src/CollapsableNav.js b/src/CollapsableNav.js index a14f51fea4..727cd7f87e 100644 --- a/src/CollapsableNav.js +++ b/src/CollapsableNav.js @@ -1,7 +1,7 @@ import React, { cloneElement } from 'react'; import BootstrapMixin from './BootstrapMixin'; import CollapsableMixin from './CollapsableMixin'; -import classSet from 'classnames'; +import classNames from 'classnames'; import domUtils from './utils/domUtils'; import ValidComponentChildren from './utils/ValidComponentChildren'; @@ -52,7 +52,7 @@ const CollapsableNav = React.createClass({ } return ( -
    +
    {ValidComponentChildren.map(this.props.children, this.props.collapsable ? this.renderCollapsableNavChildren : this.renderChildren )}
    ); diff --git a/src/DropdownButton.js b/src/DropdownButton.js index 29d3326a29..4f3d5c3d9c 100644 --- a/src/DropdownButton.js +++ b/src/DropdownButton.js @@ -1,5 +1,5 @@ import React, { cloneElement } from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import createChainedFunction from './utils/createChainedFunction'; import BootstrapMixin from './BootstrapMixin'; @@ -64,7 +64,7 @@ const DropdownButton = React.createClass({ return ( + className={classNames(this.props.className, groupClasses)}> {children} ); @@ -78,7 +78,7 @@ const DropdownButton = React.createClass({ }; return ( -
  • +
  • {children}
  • ); diff --git a/src/DropdownMenu.js b/src/DropdownMenu.js index f9c940ed34..1d3b3daae2 100644 --- a/src/DropdownMenu.js +++ b/src/DropdownMenu.js @@ -1,5 +1,5 @@ import React, { cloneElement } from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import createChainedFunction from './utils/createChainedFunction'; import ValidComponentChildren from './utils/ValidComponentChildren'; @@ -19,7 +19,7 @@ const DropdownMenu = React.createClass({ return (
      {ValidComponentChildren.map(this.props.children, this.renderMenuItem)}
    diff --git a/src/FormGroup.js b/src/FormGroup.js index 0bde453978..9e6eeb0725 100644 --- a/src/FormGroup.js +++ b/src/FormGroup.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; class FormGroup extends React.Component { render() { @@ -12,7 +12,7 @@ class FormGroup extends React.Component { }; return ( -
    +
    {this.props.children}
    ); diff --git a/src/Glyphicon.js b/src/Glyphicon.js index 7e5871ac9a..bb3e41ea19 100644 --- a/src/Glyphicon.js +++ b/src/Glyphicon.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; import constants from './constants'; @@ -22,7 +22,7 @@ const Glyphicon = React.createClass({ classes['glyphicon-' + this.props.glyph] = true; return ( - + {this.props.children} ); diff --git a/src/Grid.js b/src/Grid.js index a5fe731a7b..17c4ed5ccf 100644 --- a/src/Grid.js +++ b/src/Grid.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; const Grid = React.createClass({ propTypes: { @@ -20,7 +20,7 @@ const Grid = React.createClass({ return ( + className={classNames(this.props.className, className)}> {this.props.children} ); diff --git a/src/Input.js b/src/Input.js index 062de9d5e8..e257156ca0 100644 --- a/src/Input.js +++ b/src/Input.js @@ -1,5 +1,5 @@ import React from 'react'; -import classSet from 'classnames'; +import classNames from 'classnames'; import Button from './Button'; import FormGroup from './FormGroup'; @@ -90,17 +90,17 @@ const Input = React.createClass({ switch (this.props.type) { case 'select': input = ( - {this.props.children} ); break; case 'textarea': - input =