mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-01 11:39:28 +08:00
Use ComponentType rather than ComponentClass in grid-styled definitions (#27192)
* Use ComponentType rather than ComponentClass Update grid-styled BoxProps to accept React component classes or stateless functions * Increment version number * Fix missed type
This commit is contained in:
committed by
Ryan Cavanaugh
parent
8a4fefd543
commit
e8dcdd9186
8
types/grid-styled/index.d.ts
vendored
8
types/grid-styled/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for grid-styled 4.1
|
||||
// Type definitions for grid-styled 4.2
|
||||
// Project: https://github.com/jxnblk/grid-styled
|
||||
// Definitions by: Anton Vasin <https://github.com/antonvasin>
|
||||
// Victor Orlov <https://github.com/vittorio>
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
|
||||
import { ComponentClass } from "react";
|
||||
import { ComponentType } from "react";
|
||||
import { StyledComponentClass } from "styled-components";
|
||||
|
||||
export type ResponsiveProp = number | string | Array<string | number>;
|
||||
@@ -39,7 +39,7 @@ export interface BoxProps
|
||||
extends Omit<React.HTMLProps<HTMLDivElement>, "width" | "wrap" | "is"> {
|
||||
flex?: ResponsiveProp;
|
||||
order?: ResponsiveProp;
|
||||
is?: string | ComponentClass<any>;
|
||||
is?: string | ComponentType<any>;
|
||||
alignSelf?: ResponsiveProp;
|
||||
}
|
||||
|
||||
@@ -77,4 +77,4 @@ export const theme: Theme;
|
||||
export type DivProps = Omit<React.HTMLProps<HTMLDivElement>, "ref"> & {
|
||||
innerRef?: (el: HTMLDivElement) => any;
|
||||
};
|
||||
export const div: ComponentClass<DivProps>;
|
||||
export const div: ComponentType<DivProps>;
|
||||
|
||||
Reference in New Issue
Block a user