leecade / leecade/react-native-swiper

Can not update call state in onIndexChanged callback

Open
#1,231 7 comments 19 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

Hello I got an error when I updated my State on the callback of my function onIndexChanged.
"Warning: Cannot update a component from inside the function body of a different component."

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 reproducing the warning when updating state from the onIndexChanged callback in the React Native swiper. Trace the callback behavior and determine what change is needed so state updates no longer produce the reported warning; the issue does not name a source file or test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.