Skip to content

Commit ff9ef10

Browse files
committed
refactor: remove unnecessary assertions
1 parent 09243e3 commit ff9ef10

3 files changed

Lines changed: 7 additions & 20 deletions

File tree

src/components/Card/Card.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ import hasTouchHandler from '../../utils/hasTouchHandler';
1515
import { splitStyles } from '../../utils/splitStyles';
1616
import Surface from '../Surface';
1717

18-
type CardComposition = {
19-
Content: typeof CardContent;
20-
Actions: typeof CardActions;
21-
Cover: typeof CardCover;
22-
Title: typeof CardTitle;
23-
};
24-
2518
type OutlinedCardProps = {
2619
mode: 'outlined';
2720
elevation?: never;
@@ -283,16 +276,14 @@ const Card = ({
283276

284277
Card.displayName = 'Card';
285278

286-
const CardComponent = Card as typeof Card & CardComposition;
287-
288279
// @component ./CardContent.tsx
289-
CardComponent.Content = CardContent;
280+
Card.Content = CardContent;
290281
// @component ./CardActions.tsx
291-
CardComponent.Actions = CardActions;
282+
Card.Actions = CardActions;
292283
// @component ./CardCover.tsx
293-
CardComponent.Cover = CardCover;
284+
Card.Cover = CardCover;
294285
// @component ./CardTitle.tsx
295-
CardComponent.Title = CardTitle;
286+
Card.Title = CardTitle;
296287

297288
const styles = StyleSheet.create({
298289
innerContainer: {
@@ -307,4 +298,4 @@ const styles = StyleSheet.create({
307298
},
308299
});
309300

310-
export default CardComponent;
301+
export default Card;

src/components/TouchableRipple/TouchableRipple.native.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,4 @@ const styles = StyleSheet.create({
138138
},
139139
});
140140

141-
export default TouchableRipple as typeof TouchableRipple & {
142-
supported: boolean;
143-
};
141+
export default TouchableRipple;

src/components/TouchableRipple/TouchableRipple.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,4 @@ const styles = StyleSheet.create({
320320
},
321321
});
322322

323-
export default TouchableRipple as typeof TouchableRipple & {
324-
supported: boolean;
325-
};
323+
export default TouchableRipple;

0 commit comments

Comments
 (0)