Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf578f8

Browse files
Drakotalex111
authored andcommitted
Missing highlighted line in concurrent mode patterns example (reactjs#2490)
1 parent 2231a7c commit cf578f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/concurrent-mode-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Now, this feels a lot better! When we click Next, it gets disabled because click
152152

153153
Let's take another look at all the changes we've made since the [original example](https://codesandbox.io/s/infallible-feather-xjtbu):
154154

155-
```js{3-5,11,14,19}
155+
```js{3-5,9,11,14,19}
156156
function App() {
157157
const [resource, setResource] = useState(initialResource);
158158
const [startTransition, isPending] = useTransition({
@@ -185,7 +185,7 @@ It took us only seven lines of code to add this transition:
185185
* We've imported the `useTransition` Hook and used it the component that updates the state.
186186
* We've passed `{timeoutMs: 3000}` to stay on the previous screen for at most 3 seconds.
187187
* We've wrapped our state update into `startTransition` to tell React it's okay to delay it.
188-
* We're using `isPending` to communicate the state transition progress to the user.
188+
* We're using `isPending` to communicate the state transition progress to the user and to disable the button.
189189

190190
As a result, clicking "Next" doesn't perform an immediate state transition to an "undesirable" loading state, but instead stays on the previous screen and communicates progress there.
191191

0 commit comments

Comments
 (0)