mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-21 19:31:57 +00:00
Added missing prop to useActionState example (#8308)
* added missing prop to useactionstate example * remove pending from total in first example
This commit is contained in:
@@ -177,7 +177,7 @@ export default function Checkout() {
|
|||||||
<button onClick={handleClick}>Add Ticket{isPending ? ' 🌀' : ' '}</button>
|
<button onClick={handleClick}>Add Ticket{isPending ? ' 🌀' : ' '}</button>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<Total quantity={count} />
|
<Total quantity={count} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -190,11 +190,11 @@ const formatter = new Intl.NumberFormat('en-US', {
|
|||||||
minimumFractionDigits: 0,
|
minimumFractionDigits: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function Total({quantity, isPending}) {
|
export default function Total({quantity}) {
|
||||||
return (
|
return (
|
||||||
<div className="row total">
|
<div className="row total">
|
||||||
<span>Total</span>
|
<span>Total</span>
|
||||||
<span>{isPending ? '🌀 Updating...' : formatter.format(quantity * 9999)}</span>
|
<span>{formatter.format(quantity * 9999)}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user