Skip to content

Commit bc5214c

Browse files
committed
refactor(MenuDropdown): 使用Function组件重构 Class组件
1 parent ec62e01 commit bc5214c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/core/src/MenuDropdown/item.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ export interface ItemProps {
55
children?: React.ReactNode;
66
}
77

8-
export default class Item extends React.Component<ItemProps> {
9-
render() {
10-
return <View style={styles.item}>{this.props.children}</View>;
11-
}
8+
export default function Item(props: ItemProps) {
9+
return <View style={styles.item}>{props.children}</View>;
1210
}
1311

1412
const styles = StyleSheet.create({

0 commit comments

Comments
 (0)