Skip to content

Commit

Permalink
fix(types): Fix bad classnames usage
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Feb 20, 2017
1 parent 4b54b90 commit 1713bc6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
index.js

[libs]
interfaces/

[options]
suppress_comment=\\(.\\|\n\\)*\\s*\\$FlowFixMe.*
Expand Down
15 changes: 15 additions & 0 deletions interfaces/classnames.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// flow-typed signature: 3fba12a77525f37b0492c8dab3e04f0e
// flow-typed version: 94e9f7e0a4/classnames_v2.x.x/flow_>=v0.28.x

type $npm$classnames$Classes =
string |
{[className: string]: ?boolean } |
Array<string> |
void |
null

declare module 'classnames' {
declare function exports(
...classes: Array<$npm$classnames$Classes>
): string;
}
4 changes: 2 additions & 2 deletions lib/GridItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ export default class GridItem extends React.Component {
let newChild = React.cloneElement(child, {
className: classNames('react-grid-item', child.props.className, this.props.className, {
static: this.props.static,
resizing: this.state.resizing,
resizing: Boolean(this.state.resizing),
'react-draggable': isDraggable,
'react-draggable-dragging': this.state.dragging,
'react-draggable-dragging': Boolean(this.state.dragging),
cssTransforms: useCSSTransforms
}),
// We can set the width and height on the child, but unfortunately we can't set the position.
Expand Down

0 comments on commit 1713bc6

Please sign in to comment.