Skip to content

Commit a9501c0

Browse files
committed
🏷️ Use shotened name FC for typing component
1 parent 3801a09 commit a9501c0

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/template/componentsTypescript.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const felaComponent = (name: string, dependencies: boolean) => `${
22
dependencies
3-
? "import { React,  FunctionComponent, FelaWithStylesProps } from '../../dependencies';"
4-
: "import React, { FunctionComponent } from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';"
3+
? "import { React, FC, FelaWithStylesProps } from '../../dependencies';"
4+
: "import React, { FC } from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';"
55
}
66
77
export interface ${name}OwnProps {}
@@ -19,8 +19,8 @@ export default ${name};
1919

2020
export const felaHookComponent = (name: string, dependencies: boolean) => `${
2121
dependencies
22-
? "import { React,  FunctionComponent, FelaWithStylesProps, useFelaEnhanced } from '../../dependencies';"
23-
: "import React, { FunctionComponent } from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';\nimport { useFelaEnhanced } from 'hooks';"
22+
? "import { React, FC, FelaWithStylesProps, useFelaEnhanced } from '../../dependencies';"
23+
: "import React, { FC } from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';\nimport { useFelaEnhanced } from 'hooks';"
2424
}
2525
2626
import * as rules from './${name}.styles';
@@ -51,13 +51,13 @@ export const container: TRule = () => ({});
5151

5252
export const component = (name: string, dependencies: boolean) => `${
5353
dependencies
54-
? "import { React, FunctionComponent } from '../../dependencies';"
55-
: "import React, { FunctionComponent } from 'react';"
54+
? "import { React, FC } from '../../dependencies';"
55+
: "import React, { FC } from 'react';"
5656
}
5757
5858
export interface ${name}Props {}
5959
60-
const ${name}: FunctionComponent<${name}Props> = () => (
60+
const ${name}: FC<${name}Props> = () => (
6161
<>
6262
6363
</>

0 commit comments

Comments
 (0)