Skip to content

Commit

Permalink
Add support for falsy children, for conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
emilpalsson committed May 23, 2019
1 parent 4c18ec9 commit 66857e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-tiny-accordion",
"version": "2.0.4",
"version": "2.0.5",
"description": "Tiny, super simple accordion for React",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Accordion extends React.Component {

render() {
const { transitionDuration, transitionTimingFunction, className, openClassName } = this.props
const nodes = React.Children.map(this.props.children, (child, index) => (
const nodes = React.Children.toArray(this.props.children).filter(x => x).map((child, index) => (
<div
key={index}
ref={div => {
Expand Down

0 comments on commit 66857e9

Please sign in to comment.