I got the following code and it gives me error Type 'string | null' is not assignable to type 'string'. Type 'null' is not assignable to type 'string'.
this.userId = authInformation.userId;
So I'm trying to check if authInformation.userId returns null and If it's null, do nothing, if it's not null this.userId should be set to authInformation.userId. And it still has an error and I don't know what's the error.
const usertypecheck = authInformation.userId;
this.userId = usertypecheck !==null ? "" : usertypecheck;