the dots were not changing when using map to display data
See original GitHub issueHi I am using your module and I wrote like this :
<Swiper index={this.state.index} style={styles.swipe} autoplay={false} horizontal={true}
dotColor="transparent"
activeDotColor="transparent"
onIndexChanged={(index) => {
alert("hi")
this.setState({
index: index,
})
}}>
{swiperList.map((res,i)=>{
let durationMinutes = res.duration / 60
let durationText
if (durationMinutes < 1) {
durationText = res.duration + ' sec'
} else if (isNaN(durationMinutes)) {
durationText = ''
} else {
durationText = durationMinutes + ' min'
}
return(
<View style={styles.swiperView}>
<View style={styles.addRoutineMainCardViewMainMorning}>
<Thumbnail large source={{uri : 'https:'+res.backgroundImage.file.url , cache: 'force-cache'}} style={styles.routineCreatedCardlogoimage} />
<Thumbnail source={Images.createroutinetimeButton['morning']} style={styles.routineCreatedCardOverlayimage} />
</View>
<Text style={styles.swiperText}>{res.title}</Text>
<Text style={styles.swipertimetext}>{durationText}</Text>
</View>
)
}
)}
</Swiper>
here when I swiper the onIndexChanged is not at all calling And I did not use lopp but my data is showing twice Can you tell me how to fix this…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
Dot density—ArcGIS Pro | Documentation
Dot density symbology is one way to represent quantities in polygons on a map. With dot density symbology, the data you symbolize is...
Read more >Format a Map Chart
Format a Map chart with Projections, Areas, Labels and Series Colors. ... You have the option to not display country or region names,...
Read more >React JS - Uncaught TypeError: this.props.data.map is not ...
The .map function is only available on array. It looks like data isn't in the format you are expecting it to be (it...
Read more >Dot Density in Map Viewer: ArcGIS Online's Newest ...
With this new function, can you change the size of the dots that are displayed? I tried to use dot density for displaying...
Read more >Visualizing Point Data on a Map in ArcGIS - DAsH
You can do this with graduated symbols that change based on ... You'll see that even though only one dot is displayed at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got the same issue and I solved it by the following code:
`class Slider extends Component{ componentWillMount(){ this.props.getSliderThunk(); }
}`
@bacancy-swaroopa loop is true by default, I think you are trying to render swiperList from http request, this is a bug, you cant change the number of children from <= 1 to > 1, otherwise
onIndexChanged
would never be triggered until nextonLayout()
. A simple way to solve this problem is to set a default array to swiperList, which length should be larger than 1. if this cant solve your problem, you may try the way in my fork.