We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23fba70 commit c124f82Copy full SHA for c124f82
README.md
@@ -44,7 +44,7 @@ See the example code:
44
function MyComponent(){
45
var [counter,setCounter]=useState(0)
46
function increment(){
47
- setCount(counter+1)
+ setCounter(counter+1)
48
alert(counter) // will show 0 since the state not updated yet.
49
}
50
useEffect(()=>{
@@ -72,7 +72,7 @@ import useState from 'react-usestateref' // see this line
72
73
var [counter,setCounter,counterRef]=useState(0)
74
75
76
alert(counterRef.current) // will show 1
77
78
0 commit comments