Skip to content

Fixed issue, that caused Part to be missing from ListItem (ts) #1529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);