mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
🐛 fix Icon component ts error with cra definition
close #13205 close #19638
This commit is contained in:
parent
0b1a5409bd
commit
85fcf0fe6e
2
.jest.js
2
.jest.js
@ -31,7 +31,7 @@ module.exports = {
|
||||
'!components/*/style/index.tsx',
|
||||
'!components/style/index.tsx',
|
||||
'!components/*/locale/index.tsx',
|
||||
'!components/form/__tests__/type.test.tsx',
|
||||
'!components/*/__tests__/type.test.tsx',
|
||||
'!components/**/*/interface.{ts,tsx}',
|
||||
],
|
||||
transformIgnorePatterns,
|
||||
|
0
components/icon/__tests__/logo.svg
Normal file
0
components/icon/__tests__/logo.svg
Normal file
12
components/icon/__tests__/type.test.tsx
Normal file
12
components/icon/__tests__/type.test.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
import React from 'react';
|
||||
import Icon from '..';
|
||||
import { ReactComponent as logo } from './logo.svg';
|
||||
|
||||
describe('Icon TypeScript test', () => {
|
||||
it('empty test case placeholder to avoid jest error', () => {
|
||||
// empty
|
||||
});
|
||||
});
|
||||
|
||||
<Icon component={logo} />;
|
@ -67,7 +67,7 @@ export interface IconProps {
|
||||
title?: string;
|
||||
onKeyUp?: React.KeyboardEventHandler<HTMLElement>;
|
||||
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||
component?: React.ComponentType<CustomIconComponentProps>;
|
||||
component?: React.ComponentType<CustomIconComponentProps | React.SVGProps<SVGSVGElement>>;
|
||||
twoToneColor?: string;
|
||||
viewBox?: string;
|
||||
spin?: boolean;
|
||||
|
10
typings/custom-typings.d.ts
vendored
10
typings/custom-typings.d.ts
vendored
@ -1,4 +1,12 @@
|
||||
declare module '*.svg';
|
||||
// https://github.com/facebook/create-react-app/blob/f09d3d3a52c1b938cecc977c2bbc0942ea0a7e70/packages/react-scripts/lib/react-app.d.ts#L42-L49
|
||||
declare module '*.svg' {
|
||||
import * as React from 'react';
|
||||
|
||||
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
||||
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module 'rc-calendar*';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user