mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix typo
This commit is contained in:
+3
-3
@@ -6,7 +6,7 @@ function Component(props) {
|
||||
const [value, setValue] = useState(null);
|
||||
// NOTE: this lambda does not capture any mutable values (only the state setter)
|
||||
// and thus should be treated as readonly
|
||||
const onChange = (e) => setX((value) => value + e.target.value);
|
||||
const onChange = (e) => setValue((value) => value + e.target.value);
|
||||
|
||||
useOtherHook();
|
||||
|
||||
@@ -22,9 +22,9 @@ function Component(props) {
|
||||
|
||||
```javascript
|
||||
function Component(props) {
|
||||
useState(null);
|
||||
const setValue = useState(null)[1];
|
||||
|
||||
const onChange = (e) => setX((value) => value + e.target.value);
|
||||
const onChange = (e) => setValue((value) => value + e.target.value);
|
||||
|
||||
useOtherHook();
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ function Component(props) {
|
||||
const [value, setValue] = useState(null);
|
||||
// NOTE: this lambda does not capture any mutable values (only the state setter)
|
||||
// and thus should be treated as readonly
|
||||
const onChange = (e) => setX((value) => value + e.target.value);
|
||||
const onChange = (e) => setValue((value) => value + e.target.value);
|
||||
|
||||
useOtherHook();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user