callstack / callstack/react-native-pager-view

Expecting View State but received class androidx.recyclerview.widget.RecyclerView$SavedState instead

Open
#336 4 comments 0 reactions 0 assignees View on GitHub
android bug
Dominant language
TypeScript
Stars
3.4k
Forks
476
Avg merge
10d 21h
Merged PRs (30d)
2

Description

## Environment

![image](https://user-images.githubusercontent.com/4283871/115631798-a37a0880-a35a-11eb-94c1-c7988b35dc5f.png)

## 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.