Hi all, am a new react / typescript developer.
I am currently trying to grab user info in Typescript/React, and am getting errors because default state is null. i added a if statement to check if null but still throwing errors.
original tutorial (using functional component)- Get info about the user | Okta Developer
I added an if statement under the use effect to check if userInfo is null.
if(userInfo !== null){
userType = userInfo.type //Object is possibly 'null'.ts(2531)
}else{
userType = "not logged in or error retrieving user info"
}