Skip to content

Commit 7f6848b

Browse files
Fix confusing useTransition documentation example
Remove isPending state from TabButton component.
1 parent 0821e7d commit 7f6848b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,11 @@ export default function TabContainer() {
814814
import { useTransition } from 'react';
815815

816816
export default function TabButton({ action, children, isActive }) {
817-
const [isPending, startTransition] = useTransition();
817+
const [, startTransition] = useTransition();
818818
if (isActive) {
819819
return <b>{children}</b>
820820
}
821-
if (isPending) {
822-
return <b className="pending">{children}</b>;
823-
}
821+
824822
return (
825823
<button onClick={() => {
826824
startTransition(async () => {

0 commit comments

Comments
 (0)