Skip to content

Fix: scrapped views crash #1063

Open
MrRefactor wants to merge 3 commits intomasterfrom
fix/scrapped-views-yolo
Open

Fix: scrapped views crash #1063
MrRefactor wants to merge 3 commits intomasterfrom
fix/scrapped-views-yolo

Conversation

@MrRefactor
Copy link
Copy Markdown
Collaborator

Summary

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets an Android crash related to ViewPager2/RecyclerView “scrapped” (recycled) views by improving cleanup behavior during view recycling and teardown, and updates example dependency lockfiles to reflect the current package/pod versions.

Changes:

  • Update ViewPagerAdapter to better handle recycling by removing container children on recycle/failure-to-recycle and by detaching views from their parents more safely.
  • Add onDropViewInstance cleanup to stop internal scrolling and detach the underlying RecyclerView adapter when the native view is dropped.
  • Refresh lockfiles (CocoaPods + Bun) in the repo and example app.

Reviewed changes

Copilot reviewed 2 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
example/ios/Podfile.lock Updates resolved pod versions/checksums for the example iOS app.
example/bun.lockb Updates Bun dependency lock for the example app.
bun.lockb Updates Bun dependency lock at the repo root.
android/src/main/java/com/reactnativepagerview/ViewPagerAdapter.kt Adjusts page view attach/detach and adds recycling cleanup hooks.
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt Adds teardown cleanup on view drop for the internal RecyclerView/ViewPager2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MrRefactor MrRefactor force-pushed the fix/scrapped-views-yolo branch from 6d07957 to 2c4ea72 Compare April 6, 2026 17:49
@samarthskadam-lokal
Copy link
Copy Markdown

@MrRefactor When will be this merged?

@MrRefactor
Copy link
Copy Markdown
Collaborator Author

@MrRefactor When will be this merged?

when I will finish testing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants