Skip to content

Commit

Permalink
only join string types on classNames
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin committed Dec 4, 2017
1 parent 68eb60b commit 8716e75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class MyComponent extends React.Component {
* `onTouchStart`: Function, `callback(event) on gallery slide`
* `onMouseOver`: Function, `callback(event) on gallery slide`
* `onMouseLeave`: Function, `callback(event) on gallery slide`
* `additionalClass`: String,
* An additional className that will be added to the root node of this component.
* `additionalClass`: String,
* Additional class that will be added to the root node of the component.
* `renderCustomControls`: Function, custom controls rendering
* Use this to render custom controls or other elements on the currently displayed image (like the fullscreen button)
```javascript
Expand Down
4 changes: 2 additions & 2 deletions src/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,8 @@ export default class ImageGallery extends React.Component {
const classNames = [
'image-gallery',
this.props.additionalClass,
modalFullscreen && 'fullscreen-modal'
].filter(name => !!name).join(' ');
modalFullscreen ? 'fullscreen-modal' : '',
].filter(name => typeof name === 'string').join(' ');

return (
<div
Expand Down

0 comments on commit 8716e75

Please sign in to comment.