Skip to content

Commit

Permalink
fix: 修复静态服务根路径
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry-Su committed Jun 24, 2021
1 parent 2b3bf93 commit 257ae2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "cd ./react-17.0.1 && http-server -p 6001"
"start": "http-server -p 6001"
},
"repository": {
"type": "git",
Expand Down
7 changes: 6 additions & 1 deletion react-17.0.1/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// console.log('React', React)
function App() {
return <div>Hello, React Source Code!</div>
const [count, setCount] = React.useState(0)
return <div>
<div>{count}</div>
<button onClick={() => setCount(v => (v + 1))}>Increment</button>
</div>
}

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

0 comments on commit 257ae2c

Please sign in to comment.