microsoftgraph / msgraph-sample-reactspa

This sample demonstrates how to use the Microsoft Graph JavaScript SDK to access data in Office 365 from React browser apps.
MIT License
125 stars 105 forks source link

Why in you're example you use require but not import #63

Closed Relaxe111 closed 3 years ago

Relaxe111 commented 3 years ago

Hello, I am apologize if question is stupid but I have hot discussions with my colleague about why in the https://github.com/microsoftgraph/msgraph-training-reactspa/blob/main/demo/graph-tutorial/src/GraphService.ts#L9 is used require but not import? could someone explain this cause and why is not used es6 import instead? Would it not work with import? Thank you in advance

jasonjoh commented 3 years ago

Using import should work fine - there's no reason not to use it here. It would be something like:

import * as graph from '@microsoft/microsoft-graph-client';
Relaxe111 commented 3 years ago

Thank you )