in my react component i use msgraph but i get the message "cannot read property 'context' of undefined" My code:
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
client
.api('/me')
.get((error, response: any, rawResponse?: any) => {
console.log(response);
});
})
I tried to pass the context from my webpart to the component but then i get the error "Cannot read property 'context' of undefined"
Any idea? Thanks