Skip to content

Commit

Permalink
fix: typing on IconComponent (#241)
Browse files Browse the repository at this point in the history
* fix: typing on IconComponent

* fixing some type issues with @expo

---------

Co-authored-by: Murray Christopherson <[email protected]>
  • Loading branch information
murrple-1 and Murray Christopherson authored Aug 21, 2024
1 parent 7428e08 commit b87abb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions src/HeaderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ import type { ComponentProps, ReactNode } from 'react';
export type VisibleButtonProps = {
title: string;

IconComponent?: React.ComponentType<{
name: any; // TODO generify to support icon names
style?: any;
color?: ColorValue;
size?: number;
}>;
IconComponent?:
| React.ComponentType<{
name: any; // TODO generify to support icon names
style?: any;
size?: number;
color?: ColorValue;
}>
| React.ComponentType<{
name: any; // TODO generify to support icon names
style?: any;
size?: number;
color?: ColorValue | number;
}>;
iconName?: string;
iconSize?: number;
color?: ColorValue;
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/HeaderButtons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('HeaderButtons', () => {
const IoniconsHeaderButton = (props: HeaderButtonProps) => (
<HeaderButton
{...props}
IconComponent={({ name }) => <Text>{name}</Text>}
IconComponent={({ name }: { name: any }) => <Text>{name}</Text>}
iconSize={23}
color="blue"
/>
Expand Down

0 comments on commit b87abb1

Please sign in to comment.