Skip to content

Commit

Permalink
chore: test;
Browse files Browse the repository at this point in the history
  • Loading branch information
GrinZero committed Aug 31, 2022
1 parent ff3043f commit 8551baa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ yarn install

### 1.2 DEV

注意dev-build之前需要npm run unlink && yarn install && npm run link

## Q&S
- The operation couldn’t be completed. Unable to locate a Java Runtime

Expand Down
5 changes: 3 additions & 2 deletions project/mini-react/src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import {CountButton} from "./components"
import {CountButton} from './components';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<CountButton/>
<CountButton />
</header>
</div>
);
Expand Down
6 changes: 4 additions & 2 deletions project/mini-react/src/components/CountButton/CountButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ const CountButton = () => {
useEffect(() => {
console.log('Hello count Effect');
}, [count]);

const ref = useRef();
return (
<>
<div ref={ref}>
<div>Render by state</div>
<div>{count}</div>
<button onClick={handleClick}>Add Count</button>
</>
</div>
);
};

Expand Down

0 comments on commit 8551baa

Please sign in to comment.