Skip to content

Commit 9d29fbb

Browse files
fix(docs): remove unncessary await from dispatchAction
1 parent 44b0b5f commit 9d29fbb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,20 +811,20 @@ export default function Checkout() {
811811
const abortRef = useRef(null);
812812
const [count, dispatchAction, isPending] = useActionState(updateCartAction, 0);
813813

814-
async function addAction() {
814+
function addAction() {
815815
if (abortRef.current) {
816816
abortRef.current.abort();
817817
}
818818
abortRef.current = new AbortController();
819-
await dispatchAction({ type: 'ADD', signal: abortRef.current.signal });
819+
dispatchAction({ type: 'ADD', signal: abortRef.current.signal });
820820
}
821821

822-
async function removeAction() {
822+
function removeAction() {
823823
if (abortRef.current) {
824824
abortRef.current.abort();
825825
}
826826
abortRef.current = new AbortController();
827-
await dispatchAction({ type: 'REMOVE', signal: abortRef.current.signal });
827+
dispatchAction({ type: 'REMOVE', signal: abortRef.current.signal });
828828
}
829829

830830
return (

0 commit comments

Comments
 (0)