I'm using React-admin, and my datas in list are too long. I would like to apply a limit of charater to display.
So my idea is to get all spans and then apply a substring.
Here is my code :
useEffect(() => {
let spans = document.getElementsByTagName("span")
if (spans.length > 50) {
spans.substring(0, 50)} + "..."
}
}, [])
VSCode underline in red substring with error :
Property 'substring' does not exist on type 'HTMLCollectionOf<HTMLSpanElement>'
Any idea how to achieve this ?