I encountered a typescript error while working on my project, it says
Property 'length' does not exist on type 'Node'
.
https://i.sstatic.net/ShgTo.png
In my JavaScript code, I have deconstructed anchorNode
from the selection Object.
const selection = window.getSelection()
const {anchorNode} = selection;
Although I can access the length property of anchorNode
, typescript is indicating that it does not exist on the type Node.
Any suggestions on how to resolve this issue?