Skip to content

Commit 2d0c23a

Browse files
committed
[#45] 🐛 Fix build error by replacing 'any' with precise type definition
1 parent 540a155 commit 2d0c23a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/components/common/input/CheckboxInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { twMerge } from 'tailwind-merge'
1010
import { handleKeyDown } from '@/utils/handleKeyDown'
1111
import { toggleCheckbox } from '@/utils/toggleCheckbox'
1212

13-
interface CheckboxInputProps
13+
export interface CheckboxInputProps
1414
extends React.InputHTMLAttributes<HTMLInputElement> {
1515
label: string
1616
variant: 'checkbox' | 'check'

src/components/common/input/RadioInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const RadioInput = ({
3434
() =>
3535
onChange?.({
3636
target: { checked: true, value: props.value },
37-
} as any),
37+
} as React.ChangeEvent<HTMLInputElement>),
3838
disabled
3939
)
4040
}

src/stories/common/input/CheckboxInput.stories.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react'
22
import { useState } from 'react'
33

44
import { CheckboxInput } from '@/components/common/input/CheckboxInput'
5+
import type { CheckboxInputProps } from '@/components/common/input/CheckboxInput'
56

67
const meta: Meta<typeof CheckboxInput> = {
78
component: CheckboxInput,
@@ -24,7 +25,7 @@ export const Default: Story = {
2425
checked: false,
2526
disabled: false,
2627
},
27-
render: function Render(args: any) {
28+
render: function Render(args: CheckboxInputProps) {
2829
const [checked, setChecked] = useState(false)
2930

3031
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@@ -42,7 +43,7 @@ export const Check: Story = {
4243
checked: false,
4344
disabled: false,
4445
},
45-
render: function Render(args: any) {
46+
render: function Render(args: CheckboxInputProps) {
4647
const [checked, setChecked] = useState(false)
4748

4849
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@@ -60,7 +61,7 @@ export const DisabledCheckbox: Story = {
6061
checked: false,
6162
disabled: true,
6263
},
63-
render: function Render(args: any) {
64+
render: function Render(args: CheckboxInputProps) {
6465
return <CheckboxInput {...args} />
6566
},
6667
}
@@ -72,7 +73,7 @@ export const DisabledCheck: Story = {
7273
checked: false,
7374
disabled: true,
7475
},
75-
render: function Render(args: any) {
76+
render: function Render(args: CheckboxInputProps) {
7677
return <CheckboxInput {...args} />
7778
},
7879
}

0 commit comments

Comments
 (0)