aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/pages/another.mdx
blob: 7fb6a0231a1f2e757fb8aca81945d0663d820e15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Another Page

```js filename="demo.js" {3} copy
let a = 1;

console.log(a);
```

## Component

import { useState } from 'react'

{/* Import CSS modules */}
import styles from '../components/counters.module.css'

export const Counter = () => {
  const [count, setCount] = useState(0);
  return (
    <div>
      <button onClick={() => setCount(count + 1)} className={styles.counter}>Clicked {count} times</button>
    </div>
  );
};

<Counter/>

## External Component

import Counters from '../components/counters'

<Counters />