mirror of
https://github.com/MinazukiAmane/MiYoVerse.git
synced 2025-03-16 05:26:03 +08:00
32 lines
530 B
Plaintext
32 lines
530 B
Plaintext
# 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 />
|