I wrote this function for it :
const capitalizeClick =()=>{
var str = text.split(".") ;
let newText = str.map((arr)=>((arr[0]).toUpperCase));
setText(newText)
}
return(
<textarea className="form-control" value={text} onChange={handleOnChange} id="myBox" rows={15} />
)
but i am geting this error : Cannot read properties of undefined (reading ‘toUpperCase’)
You need to accept text as an argument to the function.