You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[React components](https://react.dev) are a powerful way to create interactive and reusable elements in your documentation. Use React directly in your MDX files without any additional setup.
10
+
[React components](https://react.dev) are a powerful way to create interactive and reusable elements in your documentation.
11
11
12
-
## Using React Components
12
+
You can use React components directly in your `MDX` files without any additional setup.
13
+
14
+
## Using React components
13
15
14
16
You can build components directly in your MDX files using [React hooks](https://react.dev/reference/react/hooks).
Use the `Counter` component in your MDX files like this:
37
+
The `Counter` component can be used in your `MDX` files like this:
36
38
37
39
```mdx
38
40
<Counter />
39
41
```
40
42
41
-
The component renders as an interactive React component in the MDX file.
43
+
The counter renders as an interactive React component.
42
44
43
45
<Counter />
44
46
45
-
## Importing Components
47
+
## Importing components
46
48
47
49
Just like in regular React, you can import components from other files.
48
50
@@ -51,20 +53,20 @@ import { ColorGenerator } from "/snippets/color-generator.jsx"
51
53
```
52
54
53
55
<Warning>
54
-
Unlike regular React, you can't import components from every MDX file. Reusable components can only be referenced from MDX files within the `snippets` folder.
56
+
Unlike regular React, you can't import components from every `MDX` file. Reusable components can only be referenced from `MDX` files within the `snippets` folder.
55
57
</Warning>
56
58
57
-
After importing the component, use it in your MDX files like this:
59
+
After importing the component, use it in your `MDX` files like this:
58
60
59
61
```mdx
60
62
<ColorGenerator />
61
63
```
62
64
63
65
Learn more about [reusable snippets](/reusable-snippets).
64
66
65
-
### Complex Example
67
+
### Complex example
66
68
67
-
You can build much more complex components. Here's an example of a color generator component that uses multiple React hooks:
69
+
You can build much more complex components. Here is an example of a color generator component that uses multiple React hooks:
0 commit comments