leecade / leecade/react-native-swiper
Explain renderScrollview in code
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Can any one explain me why there is separate code for android and ios for rendering scrollview in code. Is there any special purpose to do that??
can't we use for android as well instead of ?? will it create any issue in android?
src/index.js
renderScrollView = pages => {
if (Platform.OS === 'ios') {
return (
<ScrollView ref='scrollView'
{...this.props}
{...this.scrollViewPropOverrides()}
contentContainerStyle={[styles.wrapperIOS, this.props.style]}
contentOffset={this.state.offset}
onScrollBeginDrag={this.onScrollBegin}
onMomentumScrollEnd={this.onScrollEnd}
onScrollEndDrag={this.onScrollEndDrag}>
{pages}
</ScrollView>
)
}
return (
<ViewPagerAndroid ref='scrollView'
{...this.props}
initialPage={this.props.loop ? this.state.index + 1 : this.state.index}
onPageSelected={this.onScrollEnd}
key={pages.length}
style={[styles.wrapperAndroid, this.props.style]}>
{pages}
</ViewPagerAndroid>
)
}
Contributor guide
No contributing guide indexed for this repository
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 in src/index.js at renderScrollView and compare the iOS ScrollView branch with the Android ViewPagerAndroid branch. Trace the related props and scroll callbacks shown there, then document the platform-specific rationale and whether using ScrollView on Android is supported; done means the explanation answers the issue's questions clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100