react-native-masked-view / masked-view

React Native Masked View Library
MIT License
962 stars 121 forks source link

export MaskedViewProps #150

Closed 1mike12 closed 2 years ago

1mike12 commented 2 years ago

Overview

I created my own component that mixes text, maskedview, and gradient to make gradient texts. I wanted to be able to specify typings for my custom component.

type GradientTextProps = {
   maskedViewProps?: MaskedViewProps //cant import;
   gradientProps?: LinearGradientProps;
};
const GradientText = (props) => {
   return (
      <MaskedView {...props.gradientProps} maskElement={<Text {...props} />}>
         <LinearGradient
            {...props.gradientProps}
         >
            <Text {...props} style={[props.style, { opacity: 0 }]} />
         </LinearGradient>
      </MaskedView>
   );
};

Test Plan