Skip to content

Commit e850e72

Browse files
committed
docs: clarify necessary steps to update custom tag components
1 parent cca1827 commit e850e72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MIGRATING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ https://github.com/material-components/material-components-web/blob/master/CHANG
99

1010
## Breaking Changes
1111

12-
- The `@smui/common/elements` components are gone. They are replaced with the `SmuiElement` component exported from `@smui/common`. It takes a `tag` prop and creates an element dynamically with that tag name. There's also a `Svg` component exported from `@smui/common` if you need an svg.
12+
- The `@smui/common/elements` components are gone. Just set the `tag` prop on components now (like `<Button tag="div">`).
13+
- There's also a `Svg` component exported from `@smui/common` if you need an svg. You can't use `tag="svg"`, you have to use `component={Svg}`. (Why? It's a different DOM interface and has different props.)
14+
- Internally, they are replaced with the `SmuiElement` component exported from `@smui/common`. It takes a `tag` prop and creates an element dynamically with that tag name. You shouldn't ever need to use `SmuiElement` directly.
1315
- The "\*ComponentDev" types (like `MenuComponentDev`) are gone. You can now use the component as its type. Components that can take a `component` or `tag` prop (like `Button`) have required generic arguments that you can get around by using "InstanceType", like `let button: InstanceType<typeof Button>;`.
1416
- If you're using `classAdderBuilder`, you need to use `keyof SmuiElementMap` instead of `string` as its generic argument.
1517

0 commit comments

Comments
 (0)