react-native-screens-swiper
react-native-screens-swiper copied to clipboard
[ENHANCE] TypeScript compatibility 🧪
Hey @GeorgeHop and @dorkyboi congrats and thanks for this good work 💪🏼 I am using your library on a React Native TypeScript project. I needed to type your library to enhance my project.
Can you confirm or update some types that can not be good ? I plan to enhance your library with a new PR with it.
Thank you so much, Cheers
declare module 'react-native-screens-swiper' {
import React, { ComponentProps } from 'react';
import { FlatListProps, TextStyle, ViewStyle } from 'react-native';
export interface SwiperDataType {
tabLabel: string;
component: React.ReactNode;
props?: ComponentProps;
}
export interface SwiperStyle {
pillContainer?: ViewStyle;
pillButton?: ViewStyle;
pillActive?: ViewStyle;
pillLabel?: TextStyle;
activeLabel?: TextStyle;
borderActive?: ViewStyle;
pillsOverflow?: ViewStyle;
}
export interface SwiperProps extends FlatListProps {
style?: SwiperStyle;
data: SwiperDataType[];
isStaticPills?: boolean;
stickyHeaderEnabled?: boolean;
scrollableContainer?: boolean;
stickyHeaderIndex?: number;
}
export default class Swiper extends React.Component<SwiperProps, any> {}
}
Hi ! I think it will be great :) How I see everything is fine, so you can make the PR.
Hi @anthlasserre,
thank you for your interest in our library, it really means alot to us that people are using what we made :) I went through your types, everything seems to check out. Feel free to submit a PR and we'll release a new version as soon as possible.
Cheers!
Hi @ansar-imam I created other issue for this bug. Let's continue there.