Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove defaultProps syntax from functional components #527

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/components/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import { LoaderIcon } from "@/components/icon/components"
import Flex from "@/components/templates/flex"

export const Button = forwardRef(
(
{
label,
icon,
icon = null,

Check warning on line 11 in src/components/button/button.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
flavour,
isLoading,
loadingLabel,
onClick,
onClick = () => {},

Check warning on line 15 in src/components/button/button.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 15 in src/components/button/button.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
textTransform = "firstLetter",
iconColor,
iconSize,
Expand Down Expand Up @@ -52,8 +52,3 @@
</StyledButton>
)
)

Check warning on line 54 in src/components/button/button.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Button.defaultProps = {
onClick: () => {},
icon: null,
}
7 changes: 1 addition & 6 deletions src/components/checkbox/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import Flex from "@/components/templates/flex"
import { HiddenCheckboxInput, Checkbox as StyledCheckbox } from "./styled"

export const Checkbox = forwardRef(
(
{
checked,
disabled,
iconProps,
indeterminate,
Label,
Label = Text,

Check warning on line 15 in src/components/checkbox/checkbox.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
label,
labelProps,
labelPosition = "left",
Expand Down Expand Up @@ -73,8 +73,3 @@
)
}
)

Check warning on line 75 in src/components/checkbox/checkbox.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Checkbox.defaultProps = {
Label: Text,
labelPosition: "right",
}
Loading
Loading