Skip to content

Commit cb0fb6f

Browse files
committed
fix(scroll-shadow): linear gradient style type issue
1 parent 1d0c571 commit cb0fb6f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

example/src/app/(home)/components/scroll-shadow.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useHeaderHeight } from '@react-navigation/elements';
22
import { LinearGradient } from 'expo-linear-gradient';
33
import { ScrollShadow, Surface } from 'heroui-native';
4-
import { FlatList, Platform, ScrollView, Text, View } from 'react-native';
4+
import { Platform, ScrollView, Text, View } from 'react-native';
55
import { useSafeAreaInsets } from 'react-native-safe-area-context';
66
import { SectionTitle } from '../../../components/section-title';
77

@@ -27,14 +27,16 @@ export default function ScrollShadowScreen() {
2727
>
2828
<SectionTitle title="Horizontal" />
2929
<ScrollShadow LinearGradientComponent={LinearGradient}>
30-
<FlatList
31-
data={HORIZONTAL_ITEMS}
30+
<ScrollView
3231
horizontal
33-
renderItem={() => <Surface variant="2" className="w-32 h-16" />}
3432
showsHorizontalScrollIndicator={false}
3533
scrollEventThrottle={32}
3634
contentContainerClassName="p-5 gap-5"
37-
/>
35+
>
36+
{HORIZONTAL_ITEMS.map((item) => (
37+
<Surface key={item.id} variant="2" className="w-32 h-16" />
38+
))}
39+
</ScrollView>
3840
</ScrollShadow>
3941
<SectionTitle title="Vertical" />
4042
<ScrollShadow

src/components/scroll-shadow/scroll-shadow.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ComponentType } from 'react';
2-
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
2+
import type { ViewProps } from 'react-native';
33

44
/**
55
* Orientation of the scroll shadow
@@ -32,7 +32,7 @@ export interface LinearGradientProps {
3232
locations?: any;
3333
start?: any;
3434
end?: any;
35-
style?: StyleProp<ViewStyle>;
35+
style?: any;
3636
}
3737

3838
export type LinearGradientComponent = ComponentType<LinearGradientProps>;

0 commit comments

Comments
 (0)