React - Duplicate slider when i change infinite config
- Langage dominant
- JavaScript
- Étoiles
- 11.9k
- Forks
- 2.1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hello everyone, I'm trying to initiate the slider with `infinite: false`, and update the configuration to `infinite: true` of the slider when it is used. I then used the `beforeChange` method to update the value. It works but when the value is modified, for a few seconds the slider is displayed in duplicate.
I'm doing something wrong ?
```
constructor(props) {
super(props);
this.state = {
movies: dataMovies,
infinite: false,
};
}
```
```
render() {
const settings = {
dots: false,
infinite: this.state.infinite,
speed: 500,
slidesToShow: 5,
slidesToScroll: 5,
draggable: false,
beforeChange: (current, next) => this.setState({ infinite: true }),
};
return (
Film en tendance
{this.state.movies.map((movie) => (
))}
);
}
```

Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.