Skip to content

Commit 262f7aa

Browse files
committed
docs: separate useTransition example progression
1 parent 0821e7d commit 262f7aa

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎src/content/reference/react/useTransition.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ For example, this `TabButton` component wraps its `onClick` logic in an `action`
589589

590590
```js {8-12}
591591
export default function TabButton({ action, children, isActive }) {
592-
const [isPending, startTransition] = useTransition();
592+
const [, startTransition] = useTransition();
593593
if (isActive) {
594594
return <b>{children}</b>
595595
}
@@ -653,13 +653,10 @@ export default function TabContainer() {
653653
import { useTransition } from 'react';
654654

655655
export default function TabButton({ action, children, isActive }) {
656-
const [isPending, startTransition] = useTransition();
656+
const [, startTransition] = useTransition();
657657
if (isActive) {
658658
return <b>{children}</b>
659659
}
660-
if (isPending) {
661-
return <b className="pending">{children}</b>;
662-
}
663660
return (
664661
<button onClick={async () => {
665662
startTransition(async () => {
@@ -735,7 +732,6 @@ export default function ContactTab() {
735732
```css
736733
button { margin-right: 10px }
737734
b { display: inline-block; margin-right: 10px; }
738-
.pending { color: #777; }
739735
.items {
740736
max-height: 300px;
741737
overflow: auto;

0 commit comments

Comments
 (0)