Skip to content

Commit c3585bf

Browse files
ethanpalmclaude
andcommitted
Update React components page
- Improve language clarity and conciseness throughout - Simplify and tighten explanatory text - Fix capitalization in performance best practices - Remove redundant phrases for better flow - Enhance readability and user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bc10e94 commit c3585bf

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

react-components.mdx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ icon: "react"
77
import { Counter } from "/snippets/counter.mdx";
88
import { ColorGenerator } from "/snippets/color-generator.jsx";
99

10-
[React components](https://react.dev) are a powerful way to create interactive and reusable elements in your documentation.
11-
12-
You can 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. Use React directly in your MDX files without any additional setup.
1311

1412
## Using React Components
1513

@@ -34,13 +32,13 @@ export const Counter = () => {
3432
}
3533
```
3634

37-
The `Counter` component can then be used in your MDX files like this:
35+
Use the `Counter` component in your MDX files like this:
3836

3937
```mdx
4038
<Counter />
4139
```
4240

43-
And the component will be rendered as a React component in the MDX file.
41+
The component renders as an interactive React component in the MDX file.
4442

4543
<Counter />
4644

@@ -53,10 +51,10 @@ import { ColorGenerator } from "/snippets/color-generator.jsx"
5351
```
5452

5553
<Warning>
56-
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.
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.
5755
</Warning>
5856

59-
After importing the component, you can use it in your MDX files like this:
57+
After importing the component, use it in your MDX files like this:
6058

6159
```mdx
6260
<ColorGenerator />
@@ -66,7 +64,7 @@ Learn more about [reusable snippets](/reusable-snippets).
6664

6765
### Complex Example
6866

69-
You can also build much more complex components. Here's an example of a color generator component that uses multiple React hooks:
67+
You can build much more complex components. Here's an example of a color generator component that uses multiple React hooks:
7068

7169
```mdx /snippets/color-generator.jsx [expandable]
7270
export const ColorGenerator = () => {
@@ -181,13 +179,13 @@ export const ColorGenerator = () => {
181179
}
182180
```
183181

184-
The above component can then be used in your MDX files like this:
182+
Use the above component in your MDX files like this:
185183

186184
```mdx
187185
<ColorGenerator />
188186
```
189187

190-
And the component will be rendered as a React component in the MDX file.
188+
The component renders as an interactive React component in the MDX file.
191189

192190
<ColorGenerator />
193191

@@ -202,9 +200,9 @@ And the component will be rendered as a React component in the MDX file.
202200
- **Accessibility**: Ensure dynamic content changes are announced to screen readers
203201
</Accordion>
204202
<Accordion title="Performance Best Practices">
205-
- **Optimize Dependency Arrays**: Include only necessary dependencies in your `useEffect` dependency arrays
206-
- **Memoize Complex Calculations**: Use `useMemo` or `useCallback` for expensive operations
207-
- **Reduce Re-renders**: Break large components into smaller ones to prevent cascading re-renders
208-
- **Lazy Loading**: Consider lazy loading complex components to improve initial page load time
203+
- **Optimize dependency arrays**: Include only necessary dependencies in your `useEffect` dependency arrays
204+
- **Memoize complex calculations**: Use `useMemo` or `useCallback` for expensive operations
205+
- **Reduce re-renders**: Break large components into smaller ones to prevent cascading re-renders
206+
- **Lazy loading**: Consider lazy loading complex components to improve initial page load time
209207
</Accordion>
210208
</AccordionGroup>

0 commit comments

Comments
 (0)