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'
|
2023-04-23 10:19:58 +08:00
|
|
|
import logoVite from './assets/logo-vite.svg'
|
|
|
|
import logoElectron from './assets/logo-electron.svg'
|
2023-09-19 16:20:29 +08:00
|
|
|
import './App.css'
|
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'>
|
2023-03-30 20:02:54 +08:00
|
|
|
<div className='logo-box'>
|
2023-03-12 09:35:20 +08:00
|
|
|
<a href='https://github.com/electron-vite/electron-vite-react' target='_blank'>
|
2023-04-23 10:19:58 +08:00
|
|
|
<img src={logoVite} className='logo vite' alt='Electron + Vite logo' />
|
|
|
|
<img src={logoElectron} className='logo electron' 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'>
|
2023-04-23 10:19:58 +08:00
|
|
|
Place static files into the<code>/public</code> folder <img style={{ width: '5em' }} src='./node.svg' 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
|