callstack / callstack/react-native-pager-view

Prevent rendering all but the active view?

Đang mở
#1,002 2 bình luận 2 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
TypeScript
Star
3.4k
Fork
476
Merge trung bình
10 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu. Hãy bắt đầu bằng cách tái hiện trường hợp PagerView gồm sáu trang với offscreenPageLimit được đặt thành 1, bao gồm việc điều hướng giữa các trang, rồi so sánh hiệu năng với các trang được render riêng lẻ và với react-native-swiper. Công việc được xem là hoàn tất khi có hành vi rendering đã được chứng minh cùng với một cách triển khai cụ thể hoặc một khuyến nghị được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
mobile-dev, performance
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.