leecade / leecade/react-native-swiper

set autoplayTimeout to dynamic value not working

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

Nobody has claimed this yet.

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

Description

Which OS ?

iOS, Android

Version

Which versions are you using:

  • react-native-swiper v 1.5.14
  • react-native v0.59.8
Expected behaviour

link autoplayTimeout to state in order to show every view a given amount of time( ex: first image 5s, second image 10s ...).
I'm using onIndexChanged to get the index of the current view, set the index in a redux reducer variable and assign it to autoplayTimeout.
since setting state is not synchronous I'm returning a promise from my action creator
and with the help of await, I'm sure to get the actual index in the redux store

Actual behaviour

i have an array with 3 elements [{url:"", duration:5},{url:"", duration: 10},{url:"", duration: 15}]
the first and second view are shown for respectively 5 and 5 seconds
and the third view is show for 10 seconds.

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.

Steps to reproduce

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 by reviewing the autoplayTimeout and onIndexChanged behavior in the component, then create the missing reproduction in the examples folder using the three durations described. Confirm the reproduced views use the intended per-view timing and add or update a regression example or test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.