Skip to content

Commit c32a98c

Browse files
committed
fix: modify styles prop types
fix #195
1 parent 437287e commit c32a98c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

example/src/marquee/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ function Index() {
6161
<Carousel
6262
width={layout?.width ?? PAGE_WIDTH}
6363
height={30}
64-
style={{
65-
width: 200,
66-
}}
64+
style={[
65+
{
66+
width: 200,
67+
},
68+
]}
6769
snapEnabled={false}
6870
pagingEnabled={false}
6971
loop

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ViewStyle } from 'react-native';
1+
import type { StyleProp, ViewStyle } from 'react-native';
22
import type { PanGestureHandlerProps } from 'react-native-gesture-handler';
33
import type {
44
AnimatedStyleProp,
@@ -104,7 +104,7 @@ export type TCarouselProps<T = any> = {
104104
/**
105105
* Carousel container style
106106
*/
107-
style?: ViewStyle;
107+
style?: StyleProp<ViewStyle>;
108108
/**
109109
* PanGestureHandler props
110110
*/

0 commit comments

Comments
 (0)