Skip to content

Commit

Permalink
Merge pull request #26 from gsuke/feature/#25-remove-defaultprops
Browse files Browse the repository at this point in the history
refactor: remove "defaultProps"
  • Loading branch information
gsuke authored Sep 17, 2022
2 parents 142624c + 7da4df1 commit fea76e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ extends:
- 'next/core-web-vitals'
- 'prettier'
rules:
# https://github.com/jsx-eslint/eslint-plugin-react/issues/2396
# https://github.com/iamturns/eslint-config-airbnb-typescript/issues/203
'react/require-default-props': off
# To execute async process in onClick: https://github.com/typescript-eslint/typescript-eslint/pull/4623
'@typescript-eslint/no-misused-promises':
- error
Expand Down
8 changes: 2 additions & 6 deletions src/components/molecules/user/BaseUserName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ type Props = {
children: ReactNode;
};

export default function BaseUserName({ className, children }: Props) {
return <span className={`inline-flex items-center ${className ?? ''}`}>{children}</span>;
export default function BaseUserName({ className = '', children }: Props) {
return <span className={`inline-flex items-center ${className}`}>{children}</span>;
}

BaseUserName.defaultProps = {
className: '',
};
4 changes: 0 additions & 4 deletions src/components/organisms/text/TextList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,3 @@ export default function TextList({ userId }: Props) {
</InfiniteScroll>
);
}

TextList.defaultProps = {
userId: undefined,
};
5 changes: 0 additions & 5 deletions src/components/templates/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,3 @@ export default function Template({ floatingItems, children }: Props) {
</>
);
}

Template.defaultProps = {
floatingItems: null,
children: null,
};

1 comment on commit fea76e7

@vercel
Copy link

@vercel vercel bot commented on fea76e7 Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.