Skip to content

Commit 6ce72cf

Browse files
committed
♻️ Get rid of FC type
1 parent 1d6eda1 commit 6ce72cf

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/template/componentsTypescript.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export const felaComponent = (name: string, dependencies: boolean) => `${
22
dependencies
3-
? "import { React, FC, FelaWithStylesProps } from '../../dependencies';"
4-
: "import React, { FC } from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';"
3+
? "import { React, FelaWithStylesProps } from '../../dependencies';"
4+
: "import React from 'react';\nimport type { FelaWithStylesProps } from 'react-fela';"
55
}
66
77
export interface ${name}OwnProps {}
88
99
type ${name}Props = ${name}OwnProps & FelaWithStylesProps<${name}OwnProps, {}>;
1010
11-
const ${name}: FC<${name}Props> = ({ styles }) => (
11+
const ${name} = ({ styles }: ${name}Props) => (
1212
<div className={styles.container}>
1313
1414
</div>
@@ -19,15 +19,15 @@ export default ${name};
1919

2020
export const felaHookComponent = (name: string, dependencies: boolean) => `${
2121
dependencies
22-
? "import { React, FC, useFelaEnhanced } from '../../dependencies';"
23-
: "import React, { FC } from 'react';\nimport { useFelaEnhanced } from 'hooks';"
22+
? "import { React, useFelaEnhanced } from '../../dependencies';"
23+
: "import React from 'react';\nimport { useFelaEnhanced } from 'hooks';"
2424
}
2525
2626
import * as felaRules from './${name}.rules';
2727
2828
export interface ${name}Props {}
2929
30-
const ${name}: FC<${name}Props> = () => {
30+
const ${name} = ({}: ${name}Props) => {
3131
const { styles } = useFelaEnhanced(felaRules);
3232
3333
return (
@@ -51,13 +51,13 @@ export const container: TRule = () => ({});
5151

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

0 commit comments

Comments
 (0)