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
But unlike regular React, you can't import components from every MDX file. Re-usable components can only be referenced from MDX files within the `snippets` folder.
57
+
</Warning>
58
+
59
+
After importing the component, you can use it in your MDX files like this:
60
+
61
+
```jsx
62
+
<ColorGenerator />
63
+
```
64
+
65
+
Learn more about [reusable snippets](/reusable-snippets).
66
+
47
67
### Complex Example
48
68
49
69
You can also build much more complex components. Here's an example of a color generator component that uses multiple React hooks:
@@ -171,26 +191,6 @@ And the component will be rendered as a React component in the MDX file.
171
191
172
192
<ColorGenerator />
173
193
174
-
## Importing Components
175
-
176
-
Just like in regular React, you can import components from other files.
But unlike regular React, you can't import components from every MDX file. Re-usable components can only be referenced from MDX files within the `snippets` folder.
184
-
</Warning>
185
-
186
-
After importing the component, you can use it in your MDX files like this:
187
-
188
-
```jsx
189
-
<ColorGenerator />
190
-
```
191
-
192
-
Learn more about [reusable snippets](/reusable-snippets).
0 commit comments