feat: link and directory improvements
Changing pages now happens via Link, directory has gotten a layout change with app becoming a starting point and every page requireing their own .tsx and .css file. Components have also been added where reocurring componennts can be made and reapplied in the project. ref: N25B-96
This commit is contained in:
20
src/components/components.tsx
Normal file
20
src/components/components.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
// src/components/Counter.tsx
|
||||
import { useState } from 'react'
|
||||
//import style from './Counter.module.css' // optional, if you want a CSS module for reset button
|
||||
import '../App.css'
|
||||
|
||||
function Counter() {
|
||||
const [count, setCount] = useState(0)
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<button onClick={() => setCount((count) => count + 3)}>
|
||||
count is {count}
|
||||
</button>
|
||||
<button className='reset' onClick={() => setCount(0)}>
|
||||
Reset Counter
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Counter
|
||||
Reference in New Issue
Block a user