💼 This rule is enabled in the ✅ recommended
config.
💡 This rule is manually fixable by editor suggestions.
Enforces the use of .textContent
over .innerText
for DOM nodes.
There are some advantages of using .textContent
, like performance and more predictable behavior when updating it.
Note that there are differences between them.
const text = foo.innerText;
const {innerText} = foo;
foo.innerText = '🦄';
const text = foo.textContent;
const {textContent} = foo;
foo.textContent = '🦄';