Skip to content

Commit

Permalink
type: Fix svg props type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 10, 2022
1 parent 66f9c8e commit 444a0db
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ async function buildPathsObject(files: string[], options: SvgToFontOptions = {})
);
}

const reactSource = (name: string, source: string) => `
import React from 'react';
const reactSource = (name: string, source: string) => `import React from 'react';
export const ${name} = props => (
<svg viewBox="0 0 20 20" {...props}>${source}</svg>
<svg viewBox="0 0 20 20" width="20" height="20" {...props}>${source}</svg>
);
`;

const reactTypeSource = (name: string) => `import React from 'react';
export declare const ${name}: (props: React.HTMLAttributes<HTMLOrSVGElement>) => JSX.Element;
export declare const ${name}: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
`;

/**
Expand Down

0 comments on commit 444a0db

Please sign in to comment.