fawaz-ahmed / react-native-read-more

React native library to show text in a condensed way and expand when needed. Drop in replacement for Text component and highly customizable. Can be used with expo or native cli for react native.
https://www.npmjs.com/package/@fawazahmed/react-native-read-more
MIT License
274 stars 37 forks source link

Implement component type #50

Closed KoreanThinker closed 2 years ago

KoreanThinker commented 2 years ago

I simply defined the type.

export interface ReadMoreProps {
    style?: StyleProp<TextStyle>;
    seeMoreStyle?: StyleProp<TextStyle>;
    seeLessStyle?: StyleProp<TextStyle>;
    wrapperStyle?: StyleProp<ViewStyle>;
    children?: React.ReactNode;
    numberOfLines?: number;
    seeMoreText?: string;
    seeLessText?: string;
    animate?: boolean;
    customTextComponent?: React.ReactNode;
    ellipsis?: string;
    allowFontScaling?: boolean;
    onExpand?: () => void;
    onCollapse?: () => void;
    expandOnly?: boolean;
    seeMoreOverlapCount?: number;
    debounceSeeMoreCalc?: number;
    onLayout?: (event: LayoutChangeEvent) => void;
    onTextLayout?: (event: NativeSyntheticEvent<TextLayoutEventData>) => void;
    onReady?: () => void;
}
KoreanThinker commented 2 years ago

@fawaz-ahmed Please review it.

fawaz-ahmed commented 2 years ago

@KoreanThinker this is a great addition. Thanks for supporting. Can you also change version in package.json to 2.3.0 ?