Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Type should be exported only in the index file (#11)
Browse files Browse the repository at this point in the history
close #10
  • Loading branch information
jukben authored Apr 2, 2019
1 parent e5f3057 commit 6218671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const FILE_BANNER = `/**
*/
import * as React from 'react';
`;

const INDEX_EXTRA_CONTENT = `
export type IconComponent = React.SFC<{ className?: string }>;
`;
Expand Down Expand Up @@ -202,7 +204,7 @@ async function generateComponent(iconName, options) {

function createIndexFile(icons, options) {
const { exportPath, suffix } = options;
let content = FILE_BANNER;
let content = FILE_BANNER + INDEX_EXTRA_CONTENT;

for (icon of icons) {
name = getComponentNameFromFileName(icon);
Expand Down

0 comments on commit 6218671

Please sign in to comment.