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

docs: When 컴포넌트 문서 수정 #109

Merged
merged 1 commit into from
May 8, 2024
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
2 changes: 1 addition & 1 deletion .changeset/seven-pants-eat.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@modern-kit/react': minor
---

#100 61d6df3 Thanks @soonki-98! - feat: SwitchCase Component 추가 및 When fallback props 추가
feat: SwitchCase Component 추가 및 When fallback props 추가 - #100 61d5df3 @soonki-98
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
ignorePatterns: ['dist', '.eslintrc.*', 'babel.*'],
parser: '@typescript-eslint/parser',
plugins: ['unused-imports', 'react-refresh'],
rules: {
Expand Down
8 changes: 6 additions & 2 deletions docs/docs/react/components/When.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ condition prop으로 `boolean을 반환하는 함수`도 허용됩니다.

## Interface
```tsx
type Condition = boolean | ((...args: any[]) => boolean);
type Condition = boolean | (() => boolean);

interface WhenProps {
condition: Condition;
fallback?: React.ReactNode;
}

const When: ({ children, condition }: PropsWithChildren<WhenProps>) => JSX.Element
const When: ({
children,
condition,
fallback,
}: PropsWithChildren<WhenProps>) => JSX.Element;
```

## Usage
Expand Down