removeClippedSubviews là prop của ScrollView/FlatList, mặc định false iOS và true Android. Khi bật, RN tách (detach) native view ra khỏi view hierarchy khi nó scroll khuất khỏi viewport, gắn lại khi scroll vào.
Lợi:
- Giảm số UIView/Android.View trong tree → giảm work cho compositor mỗi frame.
- List rất dài (>50 items mỗi viewport) thấy FPS scroll cải thiện 5–15%.
Trade-off / bug:
- Image trắng: Image sẽ unload khi clipped → khi scroll lại, ảnh phải reload từ cache. Nếu cache miss (vd remote URL không có disk cache), thấy flash trắng.
- Animation reset: Animated value gắn vào view bị clipped sẽ pause/reset.
- TextInput focus: input bị clipped có thể mất focus khi scroll.
- Layout glitch: trên Android cũ (<8.0), đôi khi item bị "ghost" hoặc layout shift sai.
Đo cụ thể:
1. React DevTools Profiler hoặc Systrace — đo render time mỗi commit.
2. So sánh peak memory giữa on/off → nếu chênh nhỏ, không đáng tắt feature ổn định.
3. Test scroll fast trên device thật + ảnh remote → nếu thấy flash, tắt và tìm cách khác (thay FlatList bằng FlashList).
Khuyến nghị: mặc định true Android cho list lớn; false cho list có TextInput hoặc animation chạy. Trên 2026 với New Architecture + Fabric, prop này ít cần thiết hơn vì Fabric quản lý view tree hiệu quả hơn.