-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe9ab3a
commit dd5be3a
Showing
7 changed files
with
216 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {useMemo, useState} from "react"; | ||
|
||
export const Home = () => { | ||
const [dep, setDep] = useState(1); | ||
|
||
setTimeout(() => { | ||
setDep(2) | ||
}, 2000) | ||
|
||
if (dep === 2) { | ||
debugger; | ||
} | ||
|
||
const data = useMemo(() => { | ||
console.count('call useMemo'); | ||
return [1, 2, 3, dep] | ||
}, [dep]) | ||
|
||
return ( | ||
<div> | ||
{data.map(number => <div>{number}</div>)} | ||
</div> | ||
) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.