Xiao Chuan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
content/docs/hooks-reference.md
|
@ -580,7 +580,7 @@ Returns a stateful value for the pending state of the transition, and a function |
|
|
```js |
|
|
```js |
|
|
startTransition(() => { |
|
|
startTransition(() => { |
|
|
setCount(count + 1); |
|
|
setCount(count + 1); |
|
|
}) |
|
|
}); |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
`isPending` indicates when a transition is active to show a pending state: |
|
|
`isPending` indicates when a transition is active to show a pending state: |
|
@ -593,7 +593,7 @@ function App() { |
|
|
function handleClick() { |
|
|
function handleClick() { |
|
|
startTransition(() => { |
|
|
startTransition(() => { |
|
|
setCount(c => c + 1); |
|
|
setCount(c => c + 1); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|