Open avalanche1 opened 3 years ago
But I get TextNodes with this API.
This is more a problem with dynamic type change with the ?.
operator.
I was able to get around this error by doing the following:
mutations.forEach({ target }) => {
if (target instanceof HTMLElement) {
console.log(target.classList);
}
});
@instil-spencerc cool but we need a fix, not a work around
In the spirit of https://github.com/microsoft/TypeScript/issues/38616
MutationRecord's
addedNodes
&removedNodes
props should be typed asNodeList<Element>
In TS
^4.1.3
they areNodeList
which gives meTS2339: Property 'classList' does not exist on type 'Node'
error when trying to access one of its members'Element
-related properties: