Skip to content

Commit 9058d56

Browse files
authored
chore: add migration guide for 3.0 (#2130)
1 parent c0b4e1b commit 9058d56

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

docs/src/pages/[platform]/components/icon/react.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ Import the Icon component and styles.
4242
<Alert variation="warning" heading="Deprecated">
4343
The built-in icons were removed in version `3.0`. You can use the
4444
[react-icons](https://react-icons.github.io/react-icons) package or other
45-
`import {ICON_NAME} from
46-
'@aws-amplify/ui-react';` becomes `import {ICON_NAME} from 'react-icons/md';`
4745
React icon libraries in its place.
46+
47+
`import {ICON_NAME} from '@aws-amplify/ui-react';` => `import {ICON_NAME} from 'react-icons/md';`
48+
4849
</Alert>
4950

5051
## Custom icon

docs/src/pages/[platform]/getting-started/migration/migration.react.mdx

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,62 @@
11
import { Tabs, TabItem } from '@aws-amplify/ui-react';
22
import { Alert } from '@aws-amplify/ui-react';
33

4-
## Installation
4+
## 2.x to 3.x
55

6-
Install the latest version of the `@aws-amplify/ui-react` library.
6+
### Installation
7+
Install the 3.x version of the `@aws-amplify/ui-react` library.
78

89
<Tabs>
910
<TabItem title="npm">
1011

1112
```shell
12-
npm install aws-amplify @aws-amplify/ui-react@latest
13+
npm install aws-amplify @aws-amplify/ui-react@3.x
1314
```
1415

1516
</TabItem>
1617
<TabItem title="yarn">
1718
```shell
18-
yarn add aws-amplify @aws-amplify/ui-react@latest
19+
yarn add aws-amplify @aws-amplify/[email protected]
20+
```
21+
22+
</TabItem>
23+
</Tabs>
24+
25+
### Update and usage
26+
27+
The following breaking changes where introduced in `@aws-amplify/ui-react` major version `3.0`:
28+
29+
#### 1. We removed the built-in icons (Icon360, IconSave, etc).
30+
31+
Replace any icon components in use the react-icons package or other React icon libraries in its place.
32+
33+
```diff
34+
- import { IconSave } from '@aws-amplify/ui-react';
35+
+ import { MdSave } from 'react-icons/md';
36+
```
37+
38+
Note: We did not remove the [Icon](/react/components/icon) component, which allows customers to easily add SVG icons using the `pathData` prop.
39+
40+
#### 2. We removed `ShareText` export.
41+
42+
This export has been removed and should no longer be used.
43+
44+
## 1.x to 2.x
45+
### Installation
46+
47+
Install the 2.x version of the `@aws-amplify/ui-react` library.
48+
49+
<Tabs>
50+
<TabItem title="npm">
51+
52+
```shell
53+
npm install aws-amplify @aws-amplify/[email protected]
54+
```
55+
56+
</TabItem>
57+
<TabItem title="yarn">
58+
```shell
59+
yarn add aws-amplify @aws-amplify/[email protected]
1960
```
2061

2162
</TabItem>

0 commit comments

Comments
 (0)