callstack / callstack/react-native-pager-view
Prevent rendering all but the active view?
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.4k
- Forks
- 476
- Ø Merge
- 10 T. 21 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Hi, first of all, thanks for the great work!🙂
I want to use your `PagerView` to create a sign-up/onboarding process with a number forms one after the other. It works well but I notice that it renders all of the offscreen views as well and rendering all those components is making my app sluggish. I tried setting `offscreenPageLimit` to `1` but it still renders all six of my pages.
Would it be possible to somehow render only the active page? As moving between pages is expected to be relatively infrequent when compared to other uses, it would be nice to optimize it in this way.
If not, do you have any recommendations for alternative components/libraries I could use to achieve this? I don't want to use the expo-router as the slide in animation is slow and lags.
**Edit:** It may not be entirely a rendering issue, as I noticed if I don't move between the pages, only the active page is rendered. But for some reason, performance degrades with the number pages and the content within them. The same performance issues weren't there in something like `react-native-swiper` (which I believe is built on top of a `ScrollView` 😅) and it's not the pages themselves as individually rendered they're performant.
Beitragsleitfaden
Rechercherichtung
Es werden keine Quelldateien oder Tests genannt. Beginne damit, den sechsseitigen PagerView-Fall mit auf 1 gesetztem offscreenPageLimit zu reproduzieren, einschließlich der Navigation zwischen den Seiten, und vergleiche die Performance mit einzeln gerenderten Seiten und react-native-swiper. Als abgeschlossen gilt dies, wenn ein demonstriertes Rendering-Verhalten mit einer festgelegten Implementierung oder einer dokumentierten Empfehlung vorliegt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react-native, typescript
- Bereich
- mobile-dev, performance
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100