Skip to content

Commit c124f82

Browse files
authored
typo
1 parent 23fba70 commit c124f82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ See the example code:
4444
function MyComponent(){
4545
var [counter,setCounter]=useState(0)
4646
function increment(){
47-
setCount(counter+1)
47+
setCounter(counter+1)
4848
alert(counter) // will show 0 since the state not updated yet.
4949
}
5050
useEffect(()=>{
@@ -72,7 +72,7 @@ import useState from 'react-usestateref' // see this line
7272
function MyComponent(){
7373
var [counter,setCounter,counterRef]=useState(0)
7474
function increment(){
75-
setCount(counter+1)
75+
setCounter(counter+1)
7676
alert(counterRef.current) // will show 1
7777
}
7878
useEffect(()=>{

0 commit comments

Comments
 (0)