callstack / callstack/react-native-pager-view

Prevent rendering all but the active view?

Ouverte
#1,002 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
question
Langage dominant
TypeScript
Étoiles
3.4k
Forks
476
Merge moyen
10 j 21 h
PR mergées (30 j)
2

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Aucun fichier source ni test n’est nommé. Commencez par reproduire le cas PagerView de six pages avec offscreenPageLimit défini à 1, y compris la navigation entre les pages, et comparez les performances avec des pages rendues individuellement et avec react-native-swiper. Le travail sera considéré comme terminé lorsqu’un comportement de rendu démontré sera accompagné d’une implémentation définie ou d’une recommandation documentée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react-native, typescript
Domaine
mobile-dev, performance
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.