Skip to content

Commit

Permalink
Fix Removed child count (0) was not what we expected (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Dec 9, 2018
1 parent 8961ad9 commit e8b0baa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as shape from 'd3-shape'
import PropTypes from 'prop-types'
import React, { PureComponent } from 'react'
import { View } from 'react-native'
import Svg from 'react-native-svg'
import Svg, { G } from 'react-native-svg'
import Path from './animated-path'

class Chart extends PureComponent {
Expand Down Expand Up @@ -123,14 +123,16 @@ class Chart extends PureComponent {
animate={ animate }
animationDuration={ animationDuration }
/>
{
React.Children.map(children, child => {
if (child && !child.props.belowChart) {
return React.cloneElement(child, extraProps)
}
return null
})
}
<G>
{
React.Children.map(children, child => {
if (child && !child.props.belowChart) {
return React.cloneElement(child, extraProps)
}
return null
})
}
</G>
</Svg>
}
</View>
Expand Down

0 comments on commit e8b0baa

Please sign in to comment.