File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ type CustomTextStyleProp = StyleProp<TextStyle> | Array<StyleProp<TextStyle>>;
1919export interface IRNTextAreaProps extends TextInputProps {
2020 style ?: CustomStyleProp ;
2121 textInputStyle ?: CustomTextStyleProp ;
22+ maxCharTextStyle ?: CustomTextStyleProp ;
2223 defaultCharCount ?: number ;
2324 maxCharLimit ?: number ;
2425 charCountColor ?: string ;
@@ -34,6 +35,7 @@ const RNTextArea: React.FC<IRNTextAreaProps> = ({
3435 charCountColor = "#ccc" ,
3536 exceedCharCountColor = "red" ,
3637 onChangeText,
38+ maxCharTextStyle,
3739 ...rest
3840} ) => {
3941 const [ charCount , setCharCount ] = React . useState ( defaultCharCount || 0 ) ;
@@ -48,9 +50,12 @@ const RNTextArea: React.FC<IRNTextAreaProps> = ({
4850
4951 return (
5052 < Text
51- style = { _charCountStyle (
52- charCount > maxCharLimit ? exceedCharCountColor : charCountColor ,
53- ) }
53+ style = { [
54+ _charCountStyle (
55+ charCount > maxCharLimit ? exceedCharCountColor : charCountColor ,
56+ ) ,
57+ maxCharTextStyle ,
58+ ] }
5459 > { `${ charCount } /${ maxCharLimit } ` } </ Text >
5560 ) ;
5661 } ;
You can’t perform that action at this time.
0 commit comments