Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

optional or required depending on param is true react typescript

type Sample = {
   key1: true,
   key2?: string,
   key3: number
 } | {
   key1: false,
   key2?: string,
   key3?: never
 }
Source by www.faqcode4u.com #
 
PREVIOUS NEXT
Tagged: #optional #required #depending #param #true #react #typescript
ADD COMMENT
Topic
Name
5+6 =