mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix typo (#2021)
* 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:
committed by
Alexey Pyltsyn
parent
dda5b49f45
commit
8d9b002130
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user