Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCurrentIndex always return last snap index even after multiple data changes #178

Closed
giangpro93 opened this issue May 4, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@giangpro93
Copy link

giangpro93 commented May 4, 2022

Describe the bug
When changing data, only the handlerOffsetX for image get reset to default. The index variable for getCurrentIndex does not reset even after multiple data changes.

To Reproduce
Steps to reproduce the behavior:

  1. Snap to a non zero index. (e.g: 3)
  2. Change data.
  3. Console log getCurrentIndex when the data change by using useEffect.
  4. Change data multiple time to see that getCurrentIndex still return the same value (e.g: 3) until there is new snap event.

Expected behavior
getCurrentIndex should return 0 when there is data changes.

Versions:

  • react: v17.0.2
  • react-native: v0.67.4
  • react-native-reanimated: v2.8.0
  • react-native-reanimated-carousel: v2.3.9
  • react-native-gesture-handler: v2.4.1

Smartphone:

  • Device: iPhone 11
  • OS: iOS 15.4.1
@giangpro93 giangpro93 added the bug Something isn't working label May 4, 2022
@dohooo dohooo added this to To do in Tasks dashboard. May 4, 2022
@dohooo
Copy link
Owner

dohooo commented May 4, 2022

Describe the bug When changing data, only the handlerOffsetX for image get reset to default. The index variable for getCurrentIndex does not reset even after multiple data changes.

To Reproduce Steps to reproduce the behavior:

  1. Snap to a non zero index. (e.g: 3)
  2. Change data.
  3. Console log getCurrentIndex when the data change by using useEffect.
  4. Change data multiple time to see that getCurrentIndex still return the same value (e.g: 3) until there is new snap event.

Expected behavior getCurrentIndex should return 0 when there is data changes.

Versions:

  • react: v17.0.2
  • react-native: v0.67.4
  • react-native-reanimated: v2.8.0
  • react-native-reanimated-carousel: v2.3.9
  • react-native-gesture-handler: v2.4.1

Smartphone:

  • Device: iPhone 11
  • OS: iOS 15.4.1

THX for your tip, I will resolve it ASAP.

@dohooo dohooo closed this as completed in 9b03a4d May 4, 2022
Tasks dashboard. automation moved this from To do to Done May 4, 2022
@dohooo
Copy link
Owner

dohooo commented May 4, 2022

released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants