Skip to content

Commit

Permalink
Update exports in plop template
Browse files Browse the repository at this point in the history
Use `export default`: previous export syntax was a holdover from when
there could be multiple components with the same module name.
  • Loading branch information
lyzadanger committed Jul 20, 2023
1 parent ea3bf2d commit 5dc604d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions plop-templates/composite-component.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type {{name}}Props = CompositeProps &
/**
* TODO
*/
const {{name}} = function {{name}}({
export default function {{name}}({
children,
elementRef,

Expand Down Expand Up @@ -48,6 +48,4 @@ const {{name}} = function {{name}}({
{children}
</div>
);
};

export default {{name}};
}
6 changes: 2 additions & 4 deletions plop-templates/presentational-component.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type {{name}}Props = PresentationalProps & ComponentProps & HTMLAttribute
/**
* TODO
*/
const {{name}} = function {{name}}({
export default function {{name}}({
children,
classes,
elementRef,
Expand Down Expand Up @@ -48,6 +48,4 @@ const {{name}} = function {{name}}({
{children}
</div>
);
};

export default {{name}};
}
6 changes: 2 additions & 4 deletions plop-templates/simple-component.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type {{name}}Props = {
/**
* TODO
*/
const {{name}} = function {{name}}({ size = 'md' }: {{name}}Props) {
export default function {{name}}({ size = 'md' }: {{name}}Props) {
return (
<div
className={classnames({
Expand All @@ -18,6 +18,4 @@ const {{name}} = function {{name}}({ size = 'md' }: {{name}}Props) {
data-component="{{name}}"
/>
);
};

export default {{name}};
}

0 comments on commit 5dc604d

Please sign in to comment.