* Fix typo

Adds a missing word

* Update content/docs/hooks-faq.md

Co-Authored-By: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
Gavin Elster
2019-05-22 18:34:04 +08:00
committed by Alexey Pyltsyn
parent dda5b49f45
commit 8d9b002130

View File

@@ -694,7 +694,7 @@ function Counter() {
In more complex cases (such as if one state depends on another state), try moving the state update logic outside the effect with the [`useReducer` Hook](/docs/hooks-reference.html#usereducer). [This article](https://adamrackis.dev/state-and-use-reducer/) offers an example of how you can do this. **The identity of the `dispatch` function from `useReducer` is always stable** — even if the reducer function is declared inside the component and reads its props.
As a last resort, if you want to something like `this` in a class, you can [use a ref](/docs/hooks-faq.html#is-there-something-like-instance-variables) to hold a mutable variable. Then you can write and read to it. For example:
As a last resort, if you want something like `this` in a class, you can [use a ref](/docs/hooks-faq.html#is-there-something-like-instance-variables) to hold a mutable variable. Then you can write and read to it. For example:
```js{2-6,10-11,16}
function Example(props) {