Skip to content

Commit d48f566

Browse files
PiotrPiotr
authored andcommitted
feat(mdx): remove Themed component
1 parent 0782785 commit d48f566

File tree

3 files changed

+27
-357
lines changed

3 files changed

+27
-357
lines changed

MIGRATING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ If you are using MDX, this change enables you to use Theme UI together with
5454
+ import { Themed } from '@theme-ui/mdx'
5555
```
5656

57+
**`Themed` object is no longer a component**
58+
59+
_Previously, it was an alias for `Themed.div`._
60+
61+
- **Migration:** Whenever you're using `<Themed />`, use `<Themed.div />`
62+
instead.
63+
5764
## v0.14
5865

5966
- `theme-ui`, `@theme-ui/components` and `@theme-ui/mdx` packages no longer

packages/mdx/src/Themed.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,8 @@ const createThemedComponent = <Name extends string>(
134134
return component
135135
}
136136

137-
interface ThemedDivProps
138-
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {}
139-
140-
interface ThemedDiv {
141-
(props: ThemedDivProps): JSX.Element
142-
}
143-
144-
const _Themed: ThemedDiv = createThemedComponent('div', 'div')
145-
146137
export const defaultMdxComponents = {} as ThemedComponentsDict
147-
148-
export const Themed = _Themed as ThemedDiv & ThemedComponentsDict
138+
export const Themed: ThemedComponentsDict = {} as ThemedComponentsDict
149139

150140
tags.forEach((tag) => {
151141
const component = createThemedComponent(alias(tag), tag)

0 commit comments

Comments
 (0)