Skip to content

Commit 7fa1453

Browse files
authored
fix: updated types for styles (#616)
1 parent 338da06 commit 7fa1453

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

example/src/Dev.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const App = () => {
9999
style={styles.flatlist}
100100
contentContainerStyle={styles.flatlistContainer}
101101
/>
102-
<BottomSheetFooter appearanceBehavior={['fade', 'scale']}>
102+
<BottomSheetFooter>
103103
<RectButton style={styles.footer}>
104104
<Text style={styles.footerText}>this is a footer!</Text>
105105
</RectButton>

src/components/bottomSheet/types.d.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type React from 'react';
2-
import type { ViewStyle, Insets } from 'react-native';
2+
import type { ViewStyle, Insets, StyleProp } from 'react-native';
33
import type Animated from 'react-native-reanimated';
44
import type { PanGestureHandlerProps } from 'react-native-gesture-handler';
55
import type { BottomSheetHandleProps } from '../bottomSheetHandle';
@@ -165,17 +165,19 @@ export interface BottomSheetProps
165165
* @type Animated.AnimateStyle<ViewStyle>
166166
* @default undefined
167167
*/
168-
style?: Animated.AnimateStyle<
169-
Omit<
170-
ViewStyle,
171-
| 'flexDirection'
172-
| 'position'
173-
| 'top'
174-
| 'left'
175-
| 'bottom'
176-
| 'right'
177-
| 'opacity'
178-
| 'transform'
168+
style?: StyleProp<
169+
Animated.AnimateStyle<
170+
Omit<
171+
ViewStyle,
172+
| 'flexDirection'
173+
| 'position'
174+
| 'top'
175+
| 'left'
176+
| 'bottom'
177+
| 'right'
178+
| 'opacity'
179+
| 'transform'
180+
>
179181
>
180182
>;
181183
/**
@@ -184,24 +186,23 @@ export interface BottomSheetProps
184186
* @type ViewStyle
185187
* @default undefined
186188
*/
187-
backgroundStyle?: Omit<
188-
ViewStyle,
189-
'position' | 'top' | 'left' | 'bottom' | 'right'
189+
backgroundStyle?: StyleProp<
190+
Omit<ViewStyle, 'position' | 'top' | 'left' | 'bottom' | 'right'>
190191
>;
191192
/**
192193
* View style to be applied to the handle component.
193194
*
194195
* @type ViewStyle
195196
* @default undefined
196197
*/
197-
handleStyle?: ViewStyle;
198+
handleStyle?: StyleProp<ViewStyle>;
198199
/**
199200
* View style to be applied to the handle indicator component.
200201
*
201202
* @type ViewStyle
202203
* @default undefined
203204
*/
204-
handleIndicatorStyle?: ViewStyle;
205+
handleIndicatorStyle?: StyleProp<ViewStyle>;
205206
/**
206207
* Custom hook to provide pan gesture events handler, which will allow advance and
207208
* customize handling for pan gesture.

src/components/bottomSheetHandle/types.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type React from 'react';
2-
import type { ViewStyle } from 'react-native';
2+
import type { StyleProp, ViewStyle } from 'react-native';
33
import type Animated from 'react-native-reanimated';
44
import type { BottomSheetVariables } from '../../types';
55

@@ -11,13 +11,13 @@ export interface BottomSheetDefaultHandleProps extends BottomSheetHandleProps {
1111
* @type Animated.AnimateStyle<ViewStyle> | ViewStyle
1212
* @default undefined
1313
*/
14-
style?: ViewStyle | Animated.AnimateStyle<ViewStyle>;
14+
style?: StyleProp<ViewStyle | Animated.AnimateStyle<ViewStyle>>;
1515
/**
1616
* View style to be applied to the handle indicator.
1717
* @type Animated.AnimateStyle<ViewStyle> | ViewStyle
1818
* @default undefined
1919
*/
20-
indicatorStyle?: ViewStyle | Animated.AnimateStyle<ViewStyle>;
20+
indicatorStyle?: StyleProp<ViewStyle | Animated.AnimateStyle<ViewStyle>>;
2121
/**
2222
* Content to be added below the indicator.
2323
* @type React.ReactNode | React.ReactNode[];

0 commit comments

Comments
 (0)