cloudflare/vinext
Publicmirrored from https://github.com/cloudflare/vinextAvailable
examples/nextra-docs-template/app/content/another.mdx
19lines · modecode
| 1 | # Another Page |
| 2 | |
| 3 | This page demonstrates using React components inside MDX, including interactive client components with state. |
| 4 | |
| 5 | ## Code Example |
| 6 | |
| 7 | ```js |
| 8 | let a = 1; |
| 9 | |
| 10 | console.log(a); |
| 11 | ``` |
| 12 | |
| 13 | ## Inline Component |
| 14 | |
| 15 | You can define React components directly inside MDX files. Here's a counter built with `useState`: |
| 16 | |
| 17 | ## External Component |
| 18 | |
| 19 | Components can also be imported from separate files and used in MDX. This counter component is imported from `components/counters.tsx`: |
| 20 | |