Skip to content

Commit a2f0a45

Browse files
author
codershiba
committed
chore(types): Deprecated ReactComponentElement
1 parent 8eef7f4 commit a2f0a45

5 files changed

Lines changed: 21 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"@typescript-eslint/no-empty-interface": "off"
4+
}
5+
}

types/brainhubeu__react-carousel/brainhubeu__react-carousel-tests.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Carousel, {
55
clickToChangePlugin,
66
Dots,
77
fastSwipePlugin,
8+
type ImgProps,
89
infinitePlugin,
910
rtlPlugin,
1011
slidesToScrollPlugin,
@@ -18,7 +19,7 @@ interface MyCarouselProps {
1819

1920
interface MyCarouselState {
2021
value: number;
21-
slides: Array<React.ReactComponentElement<"img">>;
22+
slides: ImgProps[];
2223
}
2324

2425
class MyCarousel extends React.Component<MyCarouselProps, MyCarouselState> {

types/brainhubeu__react-carousel/index.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
export type ImgProps = React.ReactComponentElement<"img">;
2+
export type ImgProps = ReactComponentElement<"img">;
33

44
export interface DotsProps {
55
number?: number | undefined;
@@ -68,3 +68,10 @@ export const centeredPlugin: CarouselPluginFunc;
6868
export const slidesToScrollPlugin: CarouselPluginFunc;
6969
export const arrowsPlugin: CarouselPluginFunc;
7070
export const fastSwipePlugin: CarouselPluginFunc;
71+
72+
interface ReactComponentElement<
73+
T extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<any>,
74+
P = Pick<React.ComponentProps<T>, Exclude<keyof React.ComponentProps<T>, "key" | "ref">>,
75+
> extends React.ReactElement<P, Exclude<T, number>> {}
76+
77+
export {};

types/react/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ declare namespace React {
134134
key: string | null;
135135
}
136136

137+
/**
138+
* @deprecated
139+
*/
137140
interface ReactComponentElement<
138141
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
139142
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,

types/react/ts5.0/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ declare namespace React {
136136
key: string | null;
137137
}
138138

139+
/**
140+
* @deprecated
141+
*/
139142
interface ReactComponentElement<
140143
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
141144
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,

0 commit comments

Comments
 (0)