Add regex word counter

This commit is contained in:
klotske committed 2023-01-07 19:33:58 +03:00
1 parent a18ef5b850
commit 20a734d1e1
1 file changed
+1 -1
@@ -12,7 +12,7 @@ interface TrackedTextboxProps {
}
export const TrackedTextarea = (props: TrackedTextboxProps) => {
const wordCount = props.text.split(" ").length - 1;
const wordCount = (props.text.match(/\w+/g) || []).length;
let progressColor: string;
switch (true) {