Skip to content

Commit d164fde

Browse files
authored
Documentation edits made through Mintlify web editor
1 parent f65c1ad commit d164fde

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

react-components.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { ColorGenerator } from "/snippets/color-generator.mdx";
1111

1212
You can use React directly in your MDX files without any additional setup.
1313

14-
1514
## Using React Components
1615

1716
You can build components directly in your MDX files using [React hooks](https://react.dev/reference/react/hooks).
@@ -172,7 +171,6 @@ And the component will be rendered as a React component in the MDX file.
172171

173172
<ColorGenerator />
174173

175-
176174
## Importing Components
177175

178176
Just like in regular React, you can import components from other files.
@@ -181,15 +179,17 @@ Just like in regular React, you can import components from other files.
181179
import { ColorGenerator } from "/snippets/color-generator.mdx"
182180
```
183181

182+
<Warning>
183+
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+
184186
After importing the component, you can use it in your MDX files like this:
185187

186188
```jsx
187189
<ColorGenerator />
188190
```
189191

190-
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.
191-
192-
Learn more about this limitation in the [reusable snippets](/reusable-snippets) documentation.
192+
Learn more about [reusable snippets](/reusable-snippets).
193193

194194
## Considerations
195195

@@ -201,14 +201,10 @@ Learn more about this limitation in the [reusable snippets](/reusable-snippets)
201201
- **Initial Load**: Visitors may experience a flash of loading content before components render
202202
- **Accessibility**: Ensure dynamic content changes are announced to screen readers
203203
</Accordion>
204-
205204
<Accordion title="Performance Best Practices">
206205
- **Optimize Dependency Arrays**: Include only necessary dependencies in your `useEffect` dependency arrays
207206
- **Memoize Complex Calculations**: Use `useMemo` or `useCallback` for expensive operations
208207
- **Reduce Re-renders**: Break large components into smaller ones to prevent cascading re-renders
209208
- **Lazy Loading**: Consider lazy loading complex components to improve initial page load time
210209
</Accordion>
211-
</AccordionGroup>
212-
213-
214-
210+
</AccordionGroup>

0 commit comments

Comments
 (0)