系列: ViteReact
javascript
35 行
· 更新於 2026-02-03
App.jsx
ViteReact/my-vite-react-app/src/App.jsx
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
function App() {
const [count, setCount] = useState(0)
return (
<>
<div>
<a href="https://vite.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
)
}
export default App
相關文章
ViteReact
javascript
更新於 2026-02-03
eslint.config.js
eslint.config.js — javascript source code from the ViteReact learning materials (ViteReact/my-vite-react-app/eslint.config.js).
閱讀文章 →
ViteReact
javascript
更新於 2026-02-03
main.jsx
main.jsx — javascript source code from the ViteReact learning materials (ViteReact/my-vite-react-app/src/main.jsx).
閱讀文章 →
ViteReact
javascript
更新於 2026-02-03
vite.config.js
vite.config.js — javascript source code from the ViteReact learning materials (ViteReact/my-vite-react-app/vite.config.js).
閱讀文章 →