Skip to content

Commit e81cdf7

Browse files
committed
fix typo
1 parent 3b6d37e commit e81cdf7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

text/0000-use-state-ref.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ Introduce a new hook to reduce/improve some process.
88

99
# Basic example
1010

11-
In this example `useEffect` doesn't need a dependency for read updated `count`'s value, so
12-
that's mean whenever `count` changes we don't need to perform `useEffect` effect function.
13-
`useStateRef` just is a name, so might we need to change to better name.
11+
In this example we see `useEffect` that doesn't need a dependency to read updated `count`'s
12+
value, so that's mean we don't need to perform `useEffect` effect function event `count` will
13+
change. `useStateRef` just is a name, so might we need to change to better name.
1414

1515
```js
1616
const [count, setCount, getCount] = useStateRef();
1717

1818
useEffect(() => {
19-
const handleVisibiltuy = () => {
19+
const handleVisibility = () => {
2020
console.log(getCount());
2121
};
2222

23-
document.addEventListener('visibilitychange', handleVisibiltuy);
23+
document.addEventListener('visibilitychange', handleVisibility);
2424

25-
return () => document.removeEventListener('visibilitychange', handleVisibiltuy);
25+
return () => document.removeEventListener('visibilitychange', handleVisibility);
2626
}, []);
2727
```
2828

2929
Also, in this example `useCallback` doesn't need a dependency to know `count`'s value, so
30-
`useCallback` inside function just perform once.
30+
`useCallback` inside function just perform once. that's awesome
3131

3232
```js
3333
const [count, setCount, getCount] = useStateRef();
@@ -60,7 +60,7 @@ function useStateRef<T>(initialValue: T): [T, (nextState: T) => void, () => T] {
6060
# Drawbacks
6161

6262
This is a new hook, so we don't have any breaking change, also we can implement that by
63-
internal hook.
63+
internal React hooks.
6464

6565
# Alternatives
6666

0 commit comments

Comments
 (0)