Skip to content

Commit 94458ab

Browse files
Merge pull request #75 from yulinscottkang/r18
chore(deps): upgrade to react 18
2 parents a50042f + b6a2a97 commit 94458ab

21 files changed

+249
-173
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
This project is community-driven initiative originally created by amazing [@psrednicki](https://github.com/psrednicki), [@msasinowski](https://github.com/msasinowski) and [@tbajda](https://github.com/tbajda) and is now maintained by the Azure Maps team.
44

55
- How to link local package version:
6-
- run yarn watch in `azure-maps-react`
7-
- run yarn link `azure-maps-react`
8-
- go to the `azure-maps-playground` and run `yarn link "react-azure-maps"`
6+
- run `yarn watch` in `azure-maps-react`
7+
- run `yarn link` in `azure-maps-react`
8+
- go to `azure-maps-playground` and run `yarn link "react-azure-maps"`
9+
10+
- How to avoid "Invalid Hook call" caused by multiple React instances
11+
- go to `azure-maps-playground` and run
12+
```
13+
cd node_modules/react
14+
yarn link
15+
```
16+
- go to `azure-maps-react` and run `yarn link react`
917
1018
### Subscription key
1119

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"dependencies": {
66
"@emotion/react": "^11.4.1",
77
"@emotion/styled": "^11.3.0",
8-
"@material-ui/core": "5.0.0-beta.4",
8+
"@mui/material": "^5.9.2",
99
"@types/jest": "24.0.19",
1010
"@types/node": "12.11.7",
11-
"@types/react": "^17.0.39",
12-
"@types/react-dom": "^17.0.11",
11+
"@types/react": "^18.0.15",
12+
"@types/react-dom": "^18.0.6",
1313
"@types/react-router-dom": "^5.1.3",
14-
"react": "^17.0.2",
14+
"react": "^18.2.0",
1515
"react-azure-maps": "^0.4.2",
16-
"react-dom": "^17.0.2",
16+
"react-dom": "^18.2.0",
1717
"react-router-dom": "^5.1.2",
1818
"react-scripts": "^5.0.0-next.37",
1919
"sanitize.css": "^12.0.1",
@@ -56,4 +56,4 @@
5656
"nth-check": "^2.0.1",
5757
"ansi-html": "git+https://github.com/mahdyar/ansi-html-community#0.0.8"
5858
}
59-
}
59+
}

src/App.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import App from './App';
44

55
it('renders without crashing', () => {
66
const div = document.createElement('div');
7-
ReactDOM.render(<App />, div);
8-
ReactDOM.unmountComponentAtNode(div);
7+
const root = createRoot(div!);
8+
root.render(<App />);
9+
root.unmount();
910
});

src/Layout/Sidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import List from '@material-ui/core/List';
3-
import ListItem from '@material-ui/core/ListItem';
4-
import ListItemText from '@material-ui/core/ListItemText';
2+
import List from '@mui/material/List';
3+
import ListItem from '@mui/material/ListItem';
4+
import ListItemText from '@mui/material/ListItemText';
55
import { Link } from 'react-router-dom';
66
import { examplesList } from '../examples/examplesList';
77
import { withRouter, RouteProps } from 'react-router';

src/examples/ArrowLinesExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from 'react-azure-maps';
1010
import { AuthenticationType } from 'azure-maps-control';
1111
import { key } from '../key';
12-
import Typography from '@material-ui/core/Typography';
12+
import Typography from '@mui/material/Typography';
1313
import { wrapperStyles } from './RouteExample';
1414
import { calculateLineEndPoints, lineData, renderMultiLine } from './mapHelper';
1515
import Description from '../Layout/Description';

src/examples/BubbleLayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
IAzureMapOptions,
88
} from 'react-azure-maps';
99
import { AuthenticationType } from 'azure-maps-control';
10-
import Typography from '@material-ui/core/Typography';
10+
import Typography from '@mui/material/Typography';
1111
import { key } from '../key';
1212
import { wrapperStyles } from './RouteExample';
1313
import Description from '../Layout/Description';

src/examples/Buildings3D.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AzureMap, AzureMapsProvider, IAzureMapOptions } from 'react-azure-maps'
33
import { AuthenticationType } from 'azure-maps-control';
44
import { key } from '../key';
55
import Description from '../Layout/Description';
6-
import { Button } from '@material-ui/core';
6+
import { Button } from '@mui/material';
77
import { wrapperStyles } from './Options/ChangeOptionsWrapper';
88

99
const option: IAzureMapOptions = {

src/examples/ControlExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { AzureMap, AzureMapsProvider, IAzureMapControls, IAzureMapOptions } from 'react-azure-maps';
33
import { AuthenticationType, ControlOptions } from 'azure-maps-control';
44
import { key } from '../key';
5-
import Typography from '@material-ui/core/Typography';
5+
import Typography from '@mui/material/Typography';
66
import { wrapperStyles } from './RouteExample';
77
import Description from '../Layout/Description';
88

src/examples/CustomControl/BringDataControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { AuthenticationType, ControlPosition } from 'azure-maps-control';
1212
import { BringDataIntoViewControl } from './BringDataControlHelper';
1313
import { key } from '../../key';
14-
import Typography from '@material-ui/core/Typography';
14+
import Typography from '@mui/material/Typography';
1515
import Description from '../../Layout/Description';
1616
import { wrapperStyles } from '../RouteExample';
1717

src/examples/Live/COVID-19.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// import {AuthenticationType} from "azure-maps-control";
1010
// import {io} from "azure-maps-spatial-io";
1111
// import {key} from "../../key";
12-
// import {Button} from "@material-ui/core";
12+
// import {Button} from "@mui/material";
1313

1414
// const option: IAzureMapOptions = {
1515
// authOptions: {

0 commit comments

Comments
 (0)