We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65e7279 commit a257263Copy full SHA for a257263
src/incubator/TextField/CharCounter.tsx
@@ -7,13 +7,14 @@ import {CharCounterProps} from './types';
7
8
const CharCounter = ({maxLength, charCounterStyle, testID}: CharCounterProps) => {
9
const {value} = useContext(FieldContext);
10
+ const length = value?.length ?? 0;
11
if (_.isUndefined(maxLength)) {
12
return null;
13
}
14
15
return (
16
<Text $textNeutral style={[styles.container, charCounterStyle]} testID={testID}>
- {`${_.size(value)}/${maxLength}`}
17
+ {`${length}/${maxLength}`}
18
</Text>
19
);
20
};
0 commit comments