Skip to content

Commit 087d7e6

Browse files
Dor256M-i-k-e-l
andauthored
Add fix for carousel asBaseComponent (#1011)
* Add fix for carousel asBaseComponent * pr fix * run npm run build:dev Co-authored-by: Miki Leib <[email protected]>
1 parent feeacc7 commit 087d7e6

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

demo/src/screens/componentScreens/CarouselScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface State {
4646
}
4747

4848
class CarouselScreen extends Component<Props ,State> {
49-
carousel = React.createRef<any>();
49+
carousel = React.createRef<typeof Carousel>();
5050

5151
constructor(props: Props) {
5252
super(props);

generatedTypes/components/carousel/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ declare class Carousel extends Component<CarouselProps, CarouselState> {
6565
export { Carousel };
6666
declare const _default: React.ComponentClass<CarouselProps & {
6767
useCustomTheme?: boolean | undefined;
68-
}, any> & typeof Carousel;
68+
}, any> & Carousel & {
69+
pageControlPositions: typeof PageControlPosition;
70+
};
6971
export default _default;

src/components/carousel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ class Carousel extends Component<CarouselProps, CarouselState> {
471471
}
472472

473473
export {Carousel}; // For tests
474-
export default asBaseComponent<CarouselProps, typeof Carousel>(Carousel);
474+
export default asBaseComponent<CarouselProps, Carousel & {pageControlPositions: typeof PageControlPosition}>(Carousel);
475475

476476
const styles = StyleSheet.create({
477477
counter: {

0 commit comments

Comments
 (0)