Skip to content

Commit 257ae2c

Browse files
committed
fix: 修复静态服务根路径
1 parent 2b3bf93 commit 257ae2c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"start": "cd ./react-17.0.1 && http-server -p 6001"
7+
"start": "http-server -p 6001"
88
},
99
"repository": {
1010
"type": "git",

react-17.0.1/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
// console.log('React', React)
12
function App() {
2-
return <div>Hello, React Source Code!</div>
3+
const [count, setCount] = React.useState(0)
4+
return <div>
5+
<div>{count}</div>
6+
<button onClick={() => setCount(v => (v + 1))}>Increment</button>
7+
</div>
38
}
49

510
ReactDOM.render(<App/>, document.querySelector('#app'))

0 commit comments

Comments
 (0)