You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**By itself, this code doesn't do anything yet.** We will need to use this Hook's return values to set up our state transition. There are two values returned from `useTransition`:
89
89
90
-
*`startTransition` is a function. We'll use it to tell React *which* state update we want to defer.
91
90
*`isPending` is a boolean. It's React telling us whether that transition is ongoing at the moment.
91
+
*`startTransition` is a function. We'll use it to tell React *which* state update we want to defer.
92
92
93
93
We will use them right below.
94
94
@@ -130,10 +130,10 @@ If we make our API responses take 5 seconds, [we can confirm](https://codesandbo
130
130
131
131
There's still something that feels broken about [our last example](https://codesandbox.io/s/musing-driscoll-6nkie). Sure, it's nice not to see a "bad" loading state. **But having no indication of progress at all feels even worse!** When we click "Next", nothing happens and it feels like the app is broken.
132
132
133
-
Our `useTransition()` call returns two values: `startTransition` and `isPending`.
133
+
Our `useTransition()` call returns two values: `isPending` and `startTransition`.
We've already used `startTransition` to wrap the state update. Now we're going to use `isPending` too. React gives this boolean to us so we can tell whether **we're currently waiting for this transition to finish**. We'll use it to indicate that something is happening:
@@ -169,7 +169,7 @@ Let's take another look at all the changes we've made since the [original exampl
0 commit comments