FlatList removeClippedSubviews default on Android with Fabric
0 reputation · 03 Apr 2024, 08:13 UTC
0 reputation · 03 Apr 2024, 08:13 UTC
The goal is to decide whether React Native FlatList should explicitly disable removeClippedSubviews on Android when the new Fabric renderer is enabled.
React Native 0.66 changed the iOS default to false, while earlier versions defaulted to true. Documentation lists removeClippedSubviews as supported on iOS 8+ and Android 5.0+, but the interaction with Fabric remains undocumented. Fabric is still experimental in the latest stable release, so legacy and Fabric renderers may detach clipped subviews differently. No confirmed crash reproduction or official default for Android Fabric is available.
Does removeClippedSubviews default to false on Android when Fabric is enabled? Is enabling it on Android 13 safe for production FlatLists? Should teams explicitly set removeClippedSubviews={false} until the Fabric behavior is documented?
34775 reputation · 03 Apr 2024, 13:21 UTC
Does removeClippedSubviews default to false on Android when Fabric is enabled? No official source confirms this. The legacy Android default remains true, and Fabric’s documentation does not state a different default. The safest working assumption is that the default stays true unless you override it.
Is enabling it on Android 13 safe for production FlatLists? No public crash reports exist, but there are no documented guarantees either. Fabric’s view detachment and recycling differ from the legacy renderer, so behavior can diverge across devices and OS versions.
Should teams explicitly set removeClippedSubviews={false} until Fabric behavior is documented? Yes. Explicitly disabling it gives predictable performance and avoids relying on an undocumented default that may change in future releases.
| Confirmed | Likely / Inferred |
|---|---|
React Native 0.66 changed the iOS default to false; Android legacy default stayed true. |
Fabric retains the legacy Android default (true) because no release notes or docs mention a change. |
| Fabric is still marked experimental in the latest stable release. | Fabric’s view recycling may handle clipped subviews differently, making the legacy true behavior unreliable or suboptimal. |
No official documentation states a Fabric-specific default for removeClippedSubviews on Android. |
Future releases could flip the default or alter the prop’s effect without a major version bump. |
removeClippedSubviews={false} to every FlatList (or VirtualizedList) used on Android when Fabric is enabled.removeClippedSubviews={true} on your target device matrix before shipping.package.json and re-verify the behavior after every upgrade.# 1. Create a minimal test project
npx react-native@latest init FabricClipTest --template react-native-template-typescript
cd FabricClipTest
# 2. Enable Fabric (RN 0.76+)
echo 'newArchEnabled=true' >> android/gradle.properties
# 3. Add a FlatList that logs the effective prop value
# App.tsx
import { FlatList, View, Text, useRef, useEffect } from 'react-native';
export default function App() {
const listRef = useRef<FlatList<string>>(null);
useEffect(() => {
// @ts-ignore - internal prop for debugging
console.log('effective removeClippedSubviews:', listRef.current?.props?.removeClippedSubviews);
}, []);
return (
<FlatList
ref={listRef}
data={Array.from({ length: 200 }, (_, i) => `Item ${i}`)}
keyExtractor={(_, i) => String(i)}
renderItem={({ item }) => (
<View style={{ padding: 20, borderBottomWidth: 1, borderColor: '#ccc' }}>
<Text>{item}</Text>
</View>
)}
// removeClippedSubviews intentionally omitted
/>
);
}
# 4. Build and run on Android 13 emulator/device
npx react-native run-android
# 5. Observe the log output (Metro console or logcat)
# Expected: "effective removeClippedSubviews: true" (legacy default)
# If you see "false", the default has changed—document it and adjust your explicit setting.
If your verification step shows removeClippedSubviews resolving to false by default on Android with Fabric, you can stop explicitly setting false—but you should still document the observed version and re-check on every upgrade.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.