Releases: YIZHUANG/react-multi-carousel
Releases · YIZHUANG/react-multi-carousel
2.5.4
2.5.3
2.5.0
2.4.2
2.4.1
Changes
- better handle on children length changes back and forth-> #102 and # #101
- hide dots if there's not enough children #103
Credits
Huge thanks to @abhinavdalal-iconnect and @benhodgson87 for helping!
2.3.0
2.2.7
Changed naming of partialVisibilityGutter and fixed keyboad event listener not added
Change render method in infinite mode.
Commit: e865fab
Issue: #48
Previously clones are only set once during the entire life cyle as the following:
componentDidMount(){
this.setState({ clones: whatever });
}
render(){
return (
<>
{this.state.clones.map.....}
</>
)
}
Using such approach works, but does not allow for advanced customization. For example:
const MyComponent = () => {
const [anyState, setAnyState] = useState(null);
return (
<Carousel
infinite={true}
beforeChange={() => setAnyState('anything')}
>
<CarouselItem anyState={anyState} />
// anyState will be null as always because Carousel item is not re-rendering.
</Carousel>
)
}
This commit fixes the above.