Skip to content

Commit baeb14b

Browse files
committed
doc: update README.md
1 parent bde056b commit baeb14b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

core/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,17 @@ export declare const If: FC<PropsWithChildren<IfProps>>;
181181
## `<Switch />` `<Case />` `<Default />` Props
182182

183183
```tsx
184-
import { FC, PropsWithChildren } from 'react';
184+
import { type FC, type PropsWithChildren } from 'react';
185185
export declare const Switch: FC<PropsWithChildren<{}>>;
186-
export interface CaseProps {
186+
187+
type TagType = React.ElementType | keyof JSX.IntrinsicElements;
188+
interface CaseElementProps<T extends TagType> {
189+
as?: T;
187190
readonly condition?: boolean;
188191
}
189-
export declare const Case: FC<PropsWithChildren<CaseProps>>;
190-
export declare const Default: FC<PropsWithChildren>;
192+
export type CaseProps<T extends TagType> = CaseElementProps<T> & React.ComponentPropsWithoutRef<T>;
193+
export declare const Case: <T extends TagType>(props: CaseProps<T>) => null;
194+
export declare const Default: <T extends TagType>(props: CaseProps<T>) => null;
191195
```
192196

193197
## Development

0 commit comments

Comments
 (0)