Skip to content

Commit d5314be

Browse files
committed
Update docs
1 parent 72d2dde commit d5314be

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

react-hooks.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can use all standard React hooks in your documentation, such as `useState`,
1919

2020
## Interactive Examples
2121

22-
### 1. Creating Components Directly in MDX
22+
### Creating Components Directly in MDX
2323

2424
Create a component directly in your MDX file using React hooks to build interactive elements that respond to user actions:
2525

@@ -44,15 +44,17 @@ export const Counter = () => {
4444
<Counter />
4545
```
4646

47-
### 2. Importing Components from Snippet Files
47+
### Importing Components from Snippet Files
4848

4949
Import snippets into your MDX files to create reusable interactive components. Store snippets in the `snippets` folder for better organization. Learn more in the [reusable snippets documentation](/reusable-snippets).
5050

5151
*Interactive HSL color generator created with multiple React hooks*
5252

5353
<ColorGenerator />
5454

55-
#### Create a snippet file
55+
## Using React Hooks
56+
57+
### Create a snippet file
5658

5759
Create a new file in the `snippets` folder with your component code.
5860

@@ -171,14 +173,15 @@ export const ColorGenerator = () => {
171173
}
172174
```
173175

174-
#### Import the snippet
176+
### Import the snippet
177+
175178
Add an import statement at the top of your MDX file:
176179

177180
```jsx
178181
import { ColorGenerator } from "/snippets/color-generator.mdx"
179182
```
180183

181-
#### Use the component
184+
### Use the component
182185

183186
Add the component to your MDX content wherever needed:
184187

0 commit comments

Comments
 (0)