React Activate Swiper does not change activeDot

Asked

Viewed 41 times

0

Good afternoon, I am creating a list with Swiper but after rendering it does not change the activeDot

inserir a descrição da imagem aqui inserir a descrição da imagem aqui

var obj = -1
    const render = _.map(this.state.arrayFavorites, (itens) => {
        obj++
        return <View key={obj}>
            <TouchableWithoutFeedback
                onPress={() => Actions.salonProfileTabs({ backButton: true, salon: itens })}>
                <View style={styles.favoriteContainer}>
                    <Image
                        source={{ uri: itens.imagesURL.image1 }}
                        style={styles.favoriteBackground}
                    />
                    <View style={styles.favoriteOverlay} />
                    <TouchableOpacity
                        style={styles.deleteButton}
                        onPress={() => this.unfavorite(itens)}>
                        <Image style={{ height: 20, width: 20 }} source={Images.delete} />
                    </TouchableOpacity>
                    <Text style={styles.salonNameText}>{itens.nome}</Text>
                    <View style={styles.ratingView}>
                        <StarRating
                            disabled={true}
                            rating={itens.rating}
                            starColor={"#E9AA03"}
                            starSize={10}
                            starStyle={{
                                marginRight: 5,
                            }}
                            halfStarEnabled={true}
                        />
                        <Text style={styles.numRatingsText}>
                            ({itens.numRatings} avaliações)
                                    </Text>
                    </View>
                </View>
            </TouchableWithoutFeedback>

        </View>
    })

 return (
        <View style={styles.favoritesView}>

            <Swiper
                activeDot=""
                dot=""

                style={styles.favoritesList}>
                {
                    render
                }
            </Swiper>
            {this.renderModalRating()}
        </View>
    );

1 answer

0

I solved the problem as follows

            <Swiper
                key={this.state.arrayFavorites.length}
                showsButtons={false}
                style={styles.favoritesList}>
                {
                    render
                }
            </Swiper>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.