[Vuejs]-Typescript displays error for "this" Object saying TS2532: Object is possibly 'undefined' inside of vue methods

11👍

✅

Got it!

"this" might be undefined if used inside lambda function 🙂

just change

setProgram: (program: Program) => {

to:

setProgram: function (program: Program) {

and it works …

Leave a comment