Skip to content

Commit 31a027f

Browse files
authored
add removeClippedSubviews option to ResponsiveGrid (#80)
1 parent 1c63e50 commit 31a027f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/responsive-grid/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const ResponsiveGrid: React.FC<ResponsiveGridProps> = ({
3434
HeaderComponent = null,
3535
FooterComponent = null,
3636
direction = 'ltr',
37+
removeClippedSubviews = true,
3738
}) => {
3839
const [visibleItems, setVisibleItems] = useState<TileItem[]>([]);
3940

@@ -239,6 +240,7 @@ export const ResponsiveGrid: React.FC<ResponsiveGridProps> = ({
239240
width: '100%',
240241
}}
241242
showsVerticalScrollIndicator={showScrollIndicator}
243+
removeClippedSubviews={removeClippedSubviews}
242244
>
243245
{/* Render HeaderComponent if provided */}
244246
<View

src/responsive-grid/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ export interface ResponsiveGridProps {
8585
* @default ltr
8686
*/
8787
direction?: 'rtl' | 'ltr';
88+
89+
/**
90+
* When true, off-screen child views (whose overflow value is hidden) are automatically removed from the native view hierarchy.
91+
* This can improve performance for long lists, especially on Android when rendering remote images.
92+
* @default true
93+
*/
94+
removeClippedSubviews?: boolean;
8895
}
8996

9097
export interface TileItem {

0 commit comments

Comments
 (0)