Skip to content

Commit 9c90bcc

Browse files
authoredMar 19, 2025··
docs(compat): better outline legacy table pitfalls (#7102)
Closes #6553
1 parent 1269cfd commit 9c90bcc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎packages/compat/README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,22 @@ npm install @ui5/webcomponents-react-compat
1919
As the v1 `ui5-table` (`Table`) component is part of this package and some custom element names are equal to the new v2 `ui5-table`, importing components from the root (`import { Table } from "@ui5/webcomponents-react-compat"`) is discouraged.
2020
The primary reason is that tree-shaking capabilities are limited in the default configurations of most bundlers in dev mode. As a result, custom elements for the v1 table will still be defined, even if only the `Toolbar` is imported. This can cause unexpected behavior if the v2 table is also used in the same app.
2121

22-
**Please only import components from the file path!**
22+
> ⚠️ **Warning:** It is not supported using the v1 `Table` and the v2 `Table` in the same application!
23+
24+
> ⚠️ **Warning:** Please only import components from this package via the file path!
2325
2426
E.g.:
2527

2628
- `import { Table } from '@ui5/webcomponents-react-compat/dist/components/Table/index.js';`
2729
- `import { Toolbar } from '@ui5/webcomponents-react-compat/dist/components/Toolbar/index.js';`
2830

29-
**It is not supported using the v1 `Table` and the v2 `Table` in the same application!**
31+
In case you're still facing issues with the custom element definitions of the `Table` in development environments, you can add the web component import before any other component import in your application.
32+
33+
Following are the imports of duplicate custom element names:
34+
35+
- `Table` (`ui5-table`): `import '@ui5/webcomponents-compat/dist/Table.js';`
36+
- `TableCell` (`ui5-table-cell`): `import "@ui5/webcomponents-compat/dist/TableCell.js";`
37+
- `TableRow` (`ui5-table-row`): `import "@ui5/webcomponents-compat/dist/TableRow.js";`
3038

3139
## Documentation
3240

0 commit comments

Comments
 (0)
Please sign in to comment.