Right now my empty text box showing count 1. see the screenshot below:
I want to show 0 value for empty box. how to do that? here is my code:
export default function TextFrom(props) {
const handelUpClick = () => {
let newtext = text.toUpperCase();
setText(newtext);
};
const handelLoClick = () => {
let newtext = text.toLowerCase();
setText(newtext);
};
const handleOnChange = (event) => {
setText(event.target.value);
};
const [text, setText] = useState("");
return (
<>
..my html code
<h1>your text summary</h1>
<p>
{text.split(" ").length} words and {text.length} character
</p>
<>