leecade / leecade/react-native-swiper

[Improvement Opinion] Move onIndexChanged from UNSAFE_componentWillUpdate to componentDidUpdate

Open
#1,144 0 comments 6 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

Which OS ?

Mac Mojave

Version

Which versions are you using:

  • react-native-swiper 1.6.0-rc.3
  • react-native v0.61.2
Improvement Proposal

This is not an issue per say, but I am wondering, wouldn't it be safer for further react & react native releases to move onIndexChanged from UNSAFE_componentWillUpdate to componentDidUpdate? At the moment, onIndexChanged is the only function used there and most likely, this is going to cause crashes on the next react release

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

Locate the component lifecycle implementation containing UNSAFE_componentWillUpdate and onIndexChanged, then read how the callback is currently triggered. Compare the proposed componentDidUpdate timing with the existing behavior; done means the callback uses the safer lifecycle without changing its intended notifications, with the repository’s relevant checks passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, react-native
Domain
mobile
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.