leecade / leecade/react-native-swiper

Swiper component style prop does not work on android

Open
#326 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Passing style prop to the <Swiper /> component does not work on android.

See snippet from here

    return (
      <ViewPagerAndroid ref='scrollView'
        {...this.props}
        initialPage={this.props.loop ? this.state.index + 1 : this.state.index}
        onPageSelected={this.onScrollEnd}
        style={{flex: 1}}>
        {pages}
      </ViewPagerAndroid>
    )

I am raising a PR with a fix

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Android rendering branch in src/index.js around line 567 and inspect how the Swiper props are passed to ViewPagerAndroid, with attention to the style prop. Reproduce the issue on Android and verify that a style supplied to Swiper is reflected by the rendered component without regressing the existing layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.