In the following code
import { useMsal } from "@azure/msal-react";
function ProfileContent() {
const { instance, accounts } = useMsal();
const name = accounts[0] && accounts[0].name;
JavaScript has no problem with this, and the code works as expected. But when I make this a TypeScript file, I get errors that
Property 'name' does not exist on type 'Partial<Pick<AccountInfo, "homeAccountId" | "localAccountId" | "username">>
What has so drastically changed to the point that TypeScript believes the property within the library doesn't even exist?
accountsobject outside of the msal-react context. Here is some documentation for that particular NPM library: github.com/AzureAD/microsoft-authentication-library-for-js/tree/…