Skip to content

Commit

Permalink
Update CSSTransition.js (#126)
Browse files Browse the repository at this point in the history
support for removing multiple class names (for use with react-jss)
  • Loading branch information
adamborowski authored and jquense committed Jul 20, 2017
1 parent f5194d9 commit 9915d15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CSSTransition.js
@@ -1,13 +1,14 @@
import * as PropTypes from 'prop-types';
import addOneClass from 'dom-helpers/class/addClass';

import removeClass from 'dom-helpers/class/removeClass';
import removeOneClass from 'dom-helpers/class/removeClass';
import React from 'react';

import Transition from './Transition';
import { classNamesShape } from './utils/PropTypes';

const addClass = (node, classes) => classes.split(' ').forEach(c => addOneClass(node, c));
const addClass = (node, classes) => classes && classes.split(' ').forEach(c => addOneClass(node, c));
const removeClass = (node, classes) => classes && classes.split(' ').forEach(c => removeOneClass(node, c));

const propTypes = {
...Transition.propTypes,
Expand Down

0 comments on commit 9915d15

Please sign in to comment.