react-native-snap-carousel doesn't render properly
There is an experimental configuration (currently v3.8.4) - removeClippedSubviews
- which is set to true
by default. Setting it to false
fixed the issue form me.
I strongly recommend not using delays as it is not deterministic and changes per device.
Thanks to @auticcat who wrote this in a comment.
The same problem was coming on our project and a little trick help us . We have set default loading state to true and in componentDidMount set state to false to show Carousel
Try this , it may help you
state = { loading: true };
componentDidMount() {
setTimeout(() => {
this.setState({ loading: false });
}, 10);
}
render() {
if(this.state.loading) {
return null;
}
// return component render which contain Carousel
.........
}
I solved it by simply using removeClippedSubviews={false}