From db43b1948e8baee2bc85925e8104d0c739db955c Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Sat, 28 Nov 2015 20:21:52 +0100 Subject: [PATCH] Use ClassNames in Tooltip --- components/tooltip/Tooltip.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/tooltip/Tooltip.jsx b/components/tooltip/Tooltip.jsx index f68dc490..9ebcd429 100644 --- a/components/tooltip/Tooltip.jsx +++ b/components/tooltip/Tooltip.jsx @@ -1,5 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import ClassNames from 'classnames'; import style from './style'; const HIDE_TIMEOUT = 100; @@ -53,9 +54,9 @@ class Tooltip extends React.Component { }; render () { - let className = style.root; - if (this.props.className) className += ` ${this.props.className}`; - if (this.state.active) className += ` ${style.active}`; + const className = ClassNames(style.root, { + [style.active]: this.state.active + }, this.props.className); return (