Skip to content

Commit

Permalink
Remove type of IconComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
aykutkardas committed Apr 2, 2022
1 parent 4d54edc commit dc2e2ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ export default Icon;

```tsx
// Icon.tsx
import IcoMoon, { IconComponent } from "react-icomoon";
import IcoMoon, { IconProps } from "react-icomoon";
const iconSet = require("./selection.json");

const Icon: typeof IconComponent = (props) => (
<IcoMoon iconSet={iconSet} {...props} />
);
const Icon = (props: IconProps) => <IcoMoon iconSet={iconSet} {...props} />;

export default Icon;
```
Expand Down
4 changes: 0 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ const IcoMoon = ({
return createElement(SvgComponent || "svg", props, children);
};

type IconType = (props: IconProps) => ReactElement;

export const IconComponent: IconType = () => null;

export const iconList = (iconSet: IconSet) => {
if (!iconSet || !Array.isArray(iconSet.icons)) return null;

Expand Down

0 comments on commit dc2e2ad

Please sign in to comment.