Skip to content

Commit

Permalink
Merge pull request #54 from sunnylqm/patch-1
Browse files Browse the repository at this point in the history
fix warnings about keys for dots
  • Loading branch information
leecade committed Dec 22, 2015
2 parents e28af9b + dd7c324 commit 6c832d6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,27 +333,23 @@ export default React.createClass({
if(this.state.total <= 1) return null

let dots = []
let CustomDot = this.props.dot
let CustomActiveDot = this.props.activeDot
for(let i = 0; i < this.state.total; i++) {
dots.push(i === this.state.index
? (this.props.activeDot || <View style={{
? (<CustomActiveDot key={i} /> || <View key={i} style={{
backgroundColor: '#007aff',
width: 8,
height: 8,
borderRadius: 4,
marginLeft: 3,
marginRight: 3,
marginTop: 3,
marginBottom: 3,
margin: 3
}} />)
: (this.props.dot || <View style={{
: (<CustomDot key={i} /> || <View key={i} style={{
backgroundColor:'rgba(0,0,0,.2)',
width: 8,
height: 8,
borderRadius: 4,
marginLeft: 3,
marginRight: 3,
marginTop: 3,
marginBottom: 3,
margin: 3
}} />)
)
}
Expand Down

0 comments on commit 6c832d6

Please sign in to comment.