Closed 1mike12 closed 2 years ago
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> ); };
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.
Test Plan