meliorence / meliorence/react-native-snap-carousel
memory leak bug plz
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Is this a bug report, a feature request, or a question?
bug report!
Have you followed the required steps before opening a bug report?
(Check the step you've followed - put an x character between the square brackets ([]).)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- I have searched for existing issues and made sure that the problem hasn't already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn't a React Native bug?
(Write your answer here.) yes
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
both platforms
android 9.0
ios 14.2
Is the bug reproductible in a production environment (not a debug one)?
no
Environment
hello
memory leak occurs ParallaxImage in both platforms
and It does not occur if you annotate ParallaxImage....
my code
class MainLikeCafe extends React.Component {
constructor(props) {
super(props);
this.state = {
activeSlide: 0,
likeCafeArr: [],
};
}
onSlideBanner = (index) => {
this.setState({
activeSlide: index,
});
};
renderItem = ({ item, index }, parallaxProps) => {
return (
<View style={{ flex: 1 }}>
<View style={{ height: 300 }}>
<ParallaxImage
source={item.url ? { uri: item.url } : require('@/Assets/Images/Home/banner01.png')}
// source={{ uri: item.url }}
containerStyle={{ height: 300, borderRadius: 8 }}
style={{ resizeMode: 'cover' }}
parallaxFactor={0.3}
{...parallaxProps}
/>
</View>
</View>
);
};
render() {
let likeCafeArr = [];
if (this.props.mainList && this.props.mainList.data.likeCafe) {
likeCafeArr = this.props.mainList.data.likeCafe;
}
return (
<View style={{ marginTop: 60, paddingLeft: 20 }}>
<View style={{ marginTop: 20 }}>
<View style={{ height: 347 }}>
<Carousel
ref={(ref) => {
this.carouselRef = ref;
}}
layout={'default'}
data={likeCafeArr}
renderItem={this.renderItem}
sliderWidth={width}
sliderHeight={341}
itemWidth={width * 0.6}
inactiveSlideScale={0.7}
activeSlideAlignment={'start'}
firstItem={this.state.activeSlide}
hasParallaxImages={true}
removeClippedSubviews={true}
onSnapToItem={(index) => this.onSlideBanner(index)}
/>
</View>
</View>
</View>
);
}
}

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the ParallaxImage entry point used by the supplied Carousel example and reproduce the reported behavior on both Android and iOS with React Native 0.63.4. Compare the supplied usage with the case where ParallaxImage is omitted or annotated; done means the leak is isolated and prevented, or the limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile-dev, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100