Skip to content

Instantly share code, notes, and snippets.

@itsdouges
Last active March 20, 2020 10:01
Show Gist options
  • Save itsdouges/12a717ae484b0a4aef364013c1ce41c7 to your computer and use it in GitHub Desktop.
Save itsdouges/12a717ae484b0a4aef364013c1ce41c7 to your computer and use it in GitHub Desktop.
This is some bullshit
// Dirty hack to get generics working with forward ref [1/2]
interface CustomItemType {
<TComponentProps extends {}>(
props: CustomItemProps<TComponentProps> & { ref?: any } & Omit<
TComponentProps,
keyof CustomItemComponentProps
>,
): JSX.Element | null;
}
const CustomItem: CustomItemType = forwardRef<HTMLElement, CustomItemProps>(
// Dirty hack to get generics working with forward ref [2/2]
) as any;
export CustomItem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment