leecade / leecade/react-native-swiper
[Improvement Opinion] Move onIndexChanged from UNSAFE_componentWillUpdate to componentDidUpdate
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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