Skip to content

Commit

Permalink
Fixed issue, that caused Part to be missing from ListItem (ts) (#1529)
Browse files Browse the repository at this point in the history
* Fixed issue, that caused Part to be missing from ListItem (ts)

* Possbile additional fix required
  • Loading branch information
MakakWasTaken authored and ethanshar committed Sep 10, 2021
1 parent bd2cb77 commit 84b7f0a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
26 changes: 22 additions & 4 deletions generatedTypes/src/components/listItem/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import React from 'react';
import { ListItemProps } from './types';
export { ListItemProps };
declare const _default: React.ComponentClass<ListItemProps & {
import ListItemPart from 'src/components/listItem/ListItemPart';
import {ListItemProps} from './types';
export {ListItemProps};

declare class ListItem extends Component<ListItemProps, State> {
static displayName: string;
static Part: typeof ListItemPart;
constructor(props: ListItemProps);
onHideUnderlay(): void;
onShowUnderlay(): void;
setPressed(isPressed: boolean): void;
renderViewContainer: () => JSX.Element;
renderCustomContainer(Container: React.ComponentType): JSX.Element;
renderChildren(): React.DetailedReactHTMLElement<any, HTMLElement>[] | null | undefined;
render(): JSX.Element;
}
declare const _default: React.ComponentClass<
ListItemProps & {
useCustomTheme?: boolean | undefined;
}, any>;
},
any
> &
typeof ListItem;
export default _default;
8 changes: 5 additions & 3 deletions src/components/listItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ListItemProps} from './types';

type ListItemState = {
pressed: boolean;
}
};

class ListItem extends Component<ListItemProps, ListItemState> {
static displayName = 'ListItem';
Expand All @@ -20,7 +20,7 @@ class ListItem extends Component<ListItemProps, ListItemState> {
underlayColor: Colors.dark70
};

static Part = ListItemPart;
static Part: typeof ListItemPart;

styles = createStyles(this.props.height);

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

export {ListItemProps};

export default asBaseComponent<ListItemProps>(ListItem);
ListItem.Part = ListItemPart;

export default asBaseComponent<ListItemProps, typeof ListItem>(ListItem);

0 comments on commit 84b7f0a

Please sign in to comment.