You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using typescript 4.1.3 and I get this error Property 'propName' is used before its initialization.
I can fix it using "!", but I'm not sure how correct it is @inject propName!: propService.
Maybe someone can suggest something, thanks.
The text was updated successfully, but these errors were encountered:
Use not-null assertion when needed as you described in the subject.
Turn off strictPropertyInitialization globally in your tsconfig.json. Turning off the checking globally may be considered as a bad practice, it's quite useful overall.
Use declare property modifier introduced in TS 3.7. Note that you have to use it when useDefineForClassFields is enabled (e.g. it's mandatory for MobX's decorators) as I reported in the sibling issue.
Hello everyone!
I am using typescript 4.1.3 and I get this error
Property 'propName' is used before its initialization
.I can fix it using "!", but I'm not sure how correct it is
@inject propName!: propService
.Maybe someone can suggest something, thanks.
The text was updated successfully, but these errors were encountered: