Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions src/components/SwitchCase/SwitchCase.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

```ts
function SwitchCase(
value: string | number,
caseBy: Record<string | number, () => JSX.Element>,
value: string | number | boolean,
caseBy: Record<string | number | boolean, () => JSX.Element>,
defaultComponent: () => JSX.Element
): JSX.Element;
```
Expand All @@ -17,14 +17,14 @@ function SwitchCase(
<Interface
required
name="value"
type="string | number"
type="string | number | boolean"
description="The value to compare against. The component associated with the matching key in <code>caseBy</code> will be rendered."
/>

<Interface
required
name="caseBy"
type="Record<string | number, () => JSX.Element>"
type="Record<string | number | boolean, () => JSX.Element>"
description="An object that maps values to components to render. The keys represent possible values, and the values are functions returning the corresponding components."
/>

Expand Down
8 changes: 4 additions & 4 deletions src/components/SwitchCase/SwitchCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ type Props<Case> = {
* similar to a `switch-case` statement. It is useful when you need to conditionally render different
* components depending on a specific state.
*
* @param {string | number} value - The value to compare against.
* @param {Case} value - The value to compare against.
* The component associated with the matching key in `caseBy` will be rendered.
* @param {Record<string | number, () => JSX.Element>} caseBy - An object that maps values to
* @param {Partial<{ [P in StringifiedValue<Case>]: () => ReactElement | null }>} caseBy - An object that maps values to
* components to render. The keys represent possible values, and the values are functions returning
* the corresponding components.
* @param {() => JSX.Element} [defaultComponent] - The component to render if `value` does not match
* @param {() => ReactElement | null} [defaultComponent] - The component to render if `value` does not match
* any key in `caseBy`.
*
* @returns {JSX.Element} A React component that conditionally renders based on cases.
* @returns {ReactElement | null} A React component that conditionally renders based on cases.
*
* @example
* function App() {
Expand Down
8 changes: 4 additions & 4 deletions src/components/SwitchCase/ko/SwitchCase.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

```ts
function SwitchCase(
value: string | number,
caseBy: Record<string | number, () => JSX.Element>,
value: string | number | boolean,
caseBy: Record<string | number | boolean, () => JSX.Element>,
defaultComponent: () => JSX.Element
): JSX.Element;
```
Expand All @@ -17,14 +17,14 @@ function SwitchCase(
<Interface
required
name="value"
type="string | number"
type="string | number | boolean"
description="비교할 값이에요. <code>caseBy</code>에서 일치하는 키와 연결된 컴포넌트가 렌더링돼요."
/>

<Interface
required
name="caseBy"
type="Record<string | number, () => JSX.Element>"
type="Record<string | number | boolean, () => JSX.Element>"
description="렌더링할 컴포넌트를 값으로 맵핑하는 객체예요. 키는 가능한 값을 나타내며, 값은 해당 컴포넌트를 반환하는 함수예요."
/>

Expand Down
Loading