After switching to TypeScript, I encountered errors in some of my code related to:
Object is possibly 'undefined'
The version of TypeScript being used is 3.2.1
Below is the problematic code snippet:
this.$refs[`stud-copy-${index}`][0].innerHTML = 'Link Copied'
I attempted to handle the issue by adding an if condition to check for undefined values, but it did not solve the problem:
if (this.$refs[`stud-copy-${index}`] !== undefined) {
this.$refs[`stud-copy-${index}`][0].innerHTML = 'Link Copied'
}