2023-03-12 09:35:20 +08:00
|
|
|
import nodeLogo from './assets/node.svg'
|
2022-06-05 08:32:53 +08:00
|
|
|
import { useState } from 'react'
|
2023-03-12 09:35:20 +08:00
|
|
|
import Update from '@/components/update'
|
2022-12-22 11:31:38 +08:00
|
|
|
import './App.scss'
|
2022-06-05 08:32:53 +08:00
|
|
|
|
2022-12-22 11:31:38 +08:00
|
|
|
console.log('[App.tsx]', `Hello world from Electron ${process.versions.electron}!`)
|
|
|
|
|
|
|
|
function App() {
|
2022-06-05 08:32:53 +08:00
|
|
|
const [count, setCount] = useState(0)
|
|
|
|
return (
|
2023-03-12 09:35:20 +08:00
|
|
|
<div className='App'>
|
2022-12-22 11:31:38 +08:00
|
|
|
<div>
|
2023-03-12 09:35:20 +08:00
|
|
|
<a href='https://github.com/electron-vite/electron-vite-react' target='_blank'>
|
|
|
|
<img src='./electron-vite.svg' className='logo' alt='Electron + Vite logo' />
|
2022-12-28 23:11:57 +08:00
|
|
|
</a>
|
2022-12-22 11:31:38 +08:00
|
|
|
</div>
|
|
|
|
<h1>Electron + Vite + React</h1>
|
2023-03-12 09:35:20 +08:00
|
|
|
<div className='card'>
|
2022-12-22 11:31:38 +08:00
|
|
|
<button onClick={() => setCount((count) => count + 1)}>
|
|
|
|
count is {count}
|
|
|
|
</button>
|
2022-06-05 08:32:53 +08:00
|
|
|
<p>
|
2022-12-22 11:31:38 +08:00
|
|
|
Edit <code>src/App.tsx</code> and save to test HMR
|
2022-06-05 08:32:53 +08:00
|
|
|
</p>
|
2022-12-22 11:31:38 +08:00
|
|
|
</div>
|
2023-03-12 09:35:20 +08:00
|
|
|
<p className='read-the-docs'>
|
2022-12-28 23:11:57 +08:00
|
|
|
Click on the Electron + Vite logo to learn more
|
2022-12-22 11:31:38 +08:00
|
|
|
</p>
|
2023-03-12 09:35:20 +08:00
|
|
|
<div className='flex-center'>
|
|
|
|
Place static files into the<code>/public</code> folder <img style={{ width: '5em' }} src={nodeLogo} alt='Node logo' />
|
2022-12-22 11:31:38 +08:00
|
|
|
</div>
|
2023-03-12 09:35:20 +08:00
|
|
|
|
|
|
|
<Update />
|
2022-06-05 08:32:53 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App
|