Skip to content

Commit

Permalink
refactor: cleanup FunctionComponentWithImplicitChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jun 29, 2023
1 parent 4260693 commit 7ddde60
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PropsWithChildren, ReactElement, ReactNode, ValidationMap, WeakValidationMap } from 'react';
import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';

/**
* Type for a value that can properly be parsed by `Boolean(...)`
Expand Down Expand Up @@ -57,13 +57,7 @@ export type ComponentWithConditionPropsAsyncSupport = ComponentWithConditionProp

export type FCWithImplicitChildren<P = NonNullObject> = FunctionComponentWithImplicitChildren<P>;

export interface FunctionComponentWithImplicitChildren<P = NonNullObject> {
(props: CustomPropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
propTypes?: WeakValidationMap<P> | undefined;
contextTypes?: ValidationMap<any> | undefined;
defaultProps?: Partial<P> | undefined;
displayName?: string | undefined;
}
export type FunctionComponentWithImplicitChildren<P = NonNullObject> = FunctionComponent<CustomPropsWithChildren<P>>;

// eslint-disable-next-line @typescript-eslint/ban-types
export type NonNullObject = {} & object;
Expand Down

0 comments on commit 7ddde60

Please sign in to comment.