File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 15
15
"code" :
" type Exclusive<T, U = T> = T | U extends Record<string, unknown>\n ?\n | ({ [P in Exclude<keyof T, keyof U>]?: never } & U)\n | ({ [P in Exclude<keyof U, keyof T>]?: never } & T)\n : T | U;\n\n\n // Usage:\n type A = { name: string; email?: string; provider?: string };\n type B = { name: string; phone?: string; country?: string };\n\n type EitherOr = Exclusive<A, B>;\n\n const w: EitherOr = { name: \" John\" , email: \" [email protected] \" }; // ✅\n const x: EitherOr = { name: \" John\" , phone: \" +123 456\" }; // ✅\n const y: EitherOr = { name: \" John\" , email: \"\" , phone: \"\" }; // ⛔️\n const z: EitherOr = { name: \" John\" , phne: \"\" , provider: \"\" }; // ⛔️\n "
16
16
}
17
17
]
18
+ },
19
+ {
20
+ "name" : " React Helpers" ,
21
+ "snippets" : [
22
+ {
23
+ "title" : " Functional Component" ,
24
+ "description" : " Functional component for React JS with props." ,
25
+ "author" : " gihanrangana" ,
26
+ "tags" : [
27
+ " typescript" ,
28
+ " fuctional-component" ,
29
+ " react-props" ,
30
+ " reactjs"
31
+ ],
32
+ "contributors" : [],
33
+ "code" : " import React from 'react';\n\n interface ComponentNameProps {\n // Define specific props here\n }\n\n const ComponentName: React.FC<ComponentNameProps> = (props) => {\n return (\n <div>\n {/* Add component content here */}\n </div>\n );\n };\n\n export default ComponentName;\n "
34
+ }
35
+ ]
18
36
}
19
37
]
You can’t perform that action at this time.
0 commit comments