You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/react-app/README.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,41 @@
1
-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1
+
# React sample for Mgt
2
+
3
+
This sample demonstrates the integration of the Microsoft Graph Toolkit into a React application using [Create React App](https://github.com/facebook/create-react-app).
4
+
5
+
The sample uses the library [@microsoft/mgt-react](https://www.npmjs.com/package/@microsoft/mgt-react) to simplify usage of [Microsoft Graph Toolkit (mgt)](https://aka.ms/mgt) web components in React. The library wraps all mgt components and exports them as React components.
6
+
7
+
8
+
## Setting up MGT in a React app
9
+
10
+
11
+
1. Install
12
+
```bash
13
+
npm install @microsoft/mgt-react @microsoft/mgt
14
+
```
15
+
16
+
or
17
+
18
+
```bash
19
+
yarn add @microsoft/mgt-react @microsoft/mgt
20
+
```
21
+
22
+
2. mgt-react does not import the Microsoft Graph Toolkit components automatically. Make sure to have the toolkit imported in your app somewhere:
23
+
24
+
```js
25
+
import`@microsoft/mgt`
26
+
```
27
+
28
+
29
+
3. In your `App.js` or other components, add an import with the components you want to use
30
+
31
+
```js
32
+
import { Login, Agenda, Person } from'@microsoft/mgt-react';
0 commit comments