callstack / callstack/react-native-pager-view
Expecting View State but received class androidx.recyclerview.widget.RecyclerView$SavedState instead
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 476
- Avg merge
- 10d 21h
- Merged PRs (30d)
- 2
Description
## Environment

## Description
I think the app is crashing on start but its not easily replicable.
I believe the problem is happening because ViewPager inflate views and assign dynamically-generated ids to them. (ref: https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-collection-release/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java?source=post_page---------------------------#146)
Is there anything we can do to mitigate this crash?
Contributor guide
Research direction
Start with the issue's crash title, screenshot, and linked AndroidX ViewPager2 reference, then investigate how dynamically generated ViewPager2 IDs interact with RecyclerView state restoration. Confirm the intermittent startup crash and identify a reproducible mitigation; document the reproduction and expected behavior when the issue is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100