Skip to content
Discussion options

You must be logged in to vote

Got the solution from here

so typing this would be:

interface myTableProps <T>{
  table: Table<T>; 
}

const myTable = <T,>({ table }: myTableProps<T>) => {  
  return ( ... );
};

or to be even typesafer:

type myUnionType = NameInfo | ProjectInfo

interface myTableProps <T>{
  table: Table<T>;
}
const myTable = <T extends myUnionType>({ table }: myTableProps<T>) => {
  return ( ... );
};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@te-ce
Comment options

Answer selected by te-ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant