Axel Rauschmayer on Nostr: #TypeScript: I was perplexed why JavaScript would let me use for-of to iterate over ...
#TypeScript: I was perplexed why JavaScript would let me use for-of to iterate over the result of .querySelectorAll(), but TypeScript told me I could not do that.
Thankfully, that’s easy to fix: Simply add "DOM.Iterable" to "lib"—e.g.:
"lib": [
"es2022", "DOM", "DOM.Iterable"
],
Source: https://alanrezende.com/typescript-error-type-nodelistof-element-must-have-a-symbol-iterator-method-that-returns-an-iterator
Thankfully, that’s easy to fix: Simply add "DOM.Iterable" to "lib"—e.g.:
"lib": [
"es2022", "DOM", "DOM.Iterable"
],
Source: https://alanrezende.com/typescript-error-type-nodelistof-element-must-have-a-symbol-iterator-method-that-returns-an-iterator