Skip to content

Commit e30ee05

Browse files
Fixed issue, that caused Part to be missing from ListItem (ts) (#1529)
* Fixed issue, that caused Part to be missing from ListItem (ts) * Possbile additional fix required
1 parent 7b58df8 commit e30ee05

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
import React from 'react';
2-
import { ListItemProps } from './types';
3-
export { ListItemProps };
4-
declare const _default: React.ComponentClass<ListItemProps & {
2+
import ListItemPart from 'src/components/listItem/ListItemPart';
3+
import {ListItemProps} from './types';
4+
export {ListItemProps};
5+
6+
declare class ListItem extends Component<ListItemProps, State> {
7+
static displayName: string;
8+
static Part: typeof ListItemPart;
9+
constructor(props: ListItemProps);
10+
onHideUnderlay(): void;
11+
onShowUnderlay(): void;
12+
setPressed(isPressed: boolean): void;
13+
renderViewContainer: () => JSX.Element;
14+
renderCustomContainer(Container: React.ComponentType): JSX.Element;
15+
renderChildren(): React.DetailedReactHTMLElement<any, HTMLElement>[] | null | undefined;
16+
render(): JSX.Element;
17+
}
18+
declare const _default: React.ComponentClass<
19+
ListItemProps & {
520
useCustomTheme?: boolean | undefined;
6-
}, any>;
21+
},
22+
any
23+
> &
24+
typeof ListItem;
725
export default _default;

src/components/listItem/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {ListItemProps} from './types';
99

1010
type ListItemState = {
1111
pressed: boolean;
12-
}
12+
};
1313

1414
class ListItem extends Component<ListItemProps, ListItemState> {
1515
static displayName = 'ListItem';
@@ -20,7 +20,7 @@ class ListItem extends Component<ListItemProps, ListItemState> {
2020
underlayColor: Colors.dark70
2121
};
2222

23-
static Part = ListItemPart;
23+
static Part: typeof ListItemPart;
2424

2525
styles = createStyles(this.props.height);
2626

@@ -84,4 +84,6 @@ function createStyles(height: ListItemProps['height']) {
8484

8585
export {ListItemProps};
8686

87-
export default asBaseComponent<ListItemProps>(ListItem);
87+
ListItem.Part = ListItemPart;
88+
89+
export default asBaseComponent<ListItemProps, typeof ListItem>(ListItem);

0 commit comments

Comments
 (0)