From c6f48178aba0c82f96edd4a32587abe5a179a78f Mon Sep 17 00:00:00 2001 From: Brandon Lenz Date: Thu, 29 Apr 2021 12:15:04 -0400 Subject: [PATCH] Refactor out ommited props --- src/components/grid/Grid/Grid.tsx | 51 +++++++++++-------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/src/components/grid/Grid/Grid.tsx b/src/components/grid/Grid/Grid.tsx index 79ab896622..060fee53bc 100644 --- a/src/components/grid/Grid/Grid.tsx +++ b/src/components/grid/Grid/Grid.tsx @@ -25,41 +25,26 @@ export type CustomGridProps = GridComponentProps< > & WithCustomGridProps> +type omittedProps = + | 'mobile' + | 'tablet' + | 'desktop' + | 'widescreen' + | 'mobileLg' + | 'tabletLg' + | 'desktopLg' + | 'children' + | 'className' + | 'row' + | 'col' + | 'gap' + | 'offset' + export function isCustomProps( props: - | Omit< - DefaultGridProps, - | 'mobile' - | 'tablet' - | 'desktop' - | 'widescreen' - | 'mobileLg' - | 'tabletLg' - | 'desktopLg' - | 'children' - | 'className' - | 'row' - | 'col' - | 'gap' - | 'offset' - > - | Omit< - CustomGridProps, - | 'mobile' - | 'tablet' - | 'desktop' - | 'widescreen' - | 'mobileLg' - | 'tabletLg' - | 'desktopLg' - | 'children' - | 'className' - | 'row' - | 'col' - | 'gap' - | 'offset' - > -): props is CustomGridProps { + | Omit + | Omit, omittedProps> +): props is Omit, omittedProps> { return 'asCustom' in props }