Skip to content

Commit

Permalink
fix warnings about keys for dots
Browse files Browse the repository at this point in the history
fix warnings about keys for dots
  • Loading branch information
sunnylqm committed Oct 14, 2015
1 parent 7b973f3 commit dd7c324
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 dd7c324

Please sign in to comment.