Skip to content

Commit 669d865

Browse files
committed
♻️ Use named exports instead of default export in TS components
1 parent 6ce72cf commit 669d865

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/template/componentsTypescript.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ export interface ${name}OwnProps {}
88
99
type ${name}Props = ${name}OwnProps & FelaWithStylesProps<${name}OwnProps, {}>;
1010
11-
const ${name} = ({ styles }: ${name}Props) => (
11+
export const ${name} = ({ styles }: ${name}Props) => (
1212
<div className={styles.container}>
1313
1414
</div>
1515
);
16-
17-
export default ${name};
1816
`;
1917

2018
export const felaHookComponent = (name: string, dependencies: boolean) => `${
@@ -27,7 +25,7 @@ import * as felaRules from './${name}.rules';
2725
2826
export interface ${name}Props {}
2927
30-
const ${name} = ({}: ${name}Props) => {
28+
export const ${name} = ({}: ${name}Props) => {
3129
const { styles } = useFelaEnhanced(felaRules);
3230
3331
return (
@@ -36,8 +34,6 @@ const ${name} = ({}: ${name}Props) => {
3634
</div>
3735
);
3836
};
39-
40-
export default ${name};
4137
`;
4238

4339
export const styles = (dependencies: boolean) => `${
@@ -57,11 +53,9 @@ export const component = (name: string, dependencies: boolean) => `${
5753
5854
export interface ${name}Props {}
5955
60-
const ${name} = ({}: ${name}Props) => (
56+
export const ${name} = ({}: ${name}Props) => (
6157
<>
6258
6359
</>
6460
);
65-
66-
export default ${name};
6761
`;

0 commit comments

Comments
 (0)