Skip to content

Commit 6b68bfb

Browse files
authored
update omit example
1 parent 32ba95a commit 6b68bfb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ADVANCED.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,7 @@ export interface Props {
292292
label: React.ReactNode // this will conflict with the InputElement's label
293293
}
294294

295-
// here is the magic - omitting an attribute
296-
type Diff<T extends string, U extends string> = ({ [P in T]: P } &
297-
{ [P in U]: never } & { [x: string]: never })[T];
298-
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
299-
// end of magic
295+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
300296

301297
// usage
302298
export const Checkbox = (

0 commit comments

Comments
 (0)