Skip to content

Commit d245b2e

Browse files
committed
took out react section
1 parent b5965b0 commit d245b2e

File tree

1 file changed

+0
-32
lines changed
  • apps/portal/src/app/payments/x402

1 file changed

+0
-32
lines changed

apps/portal/src/app/payments/x402/page.mdx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -156,38 +156,6 @@ try {
156156
}
157157
```
158158

159-
### React Integration
160-
161-
Use with React hooks for better UX:
162-
163-
```typescript
164-
import { useActiveWallet } from "thirdweb/react";
165-
import { useMutation } from "@tanstack/react-query";
166-
167-
function PayableAPICall() {
168-
const wallet = useActiveWallet();
169-
170-
const paidApiCall = useMutation({
171-
mutationFn: async () => {
172-
if (!wallet) throw new Error("Wallet not connected");
173-
174-
const fetchWithPay = wrapFetchWithPayment(fetch, client, wallet);
175-
const response = await fetchWithPay('/api/paid-endpoint');
176-
return response.json();
177-
},
178-
});
179-
180-
return (
181-
<button
182-
onClick={() => paidApiCall.mutate()}
183-
disabled={!wallet || paidApiCall.isPending}
184-
>
185-
{paidApiCall.isPending ? "Processing Payment..." : "Call Paid API"}
186-
</button>
187-
);
188-
}
189-
```
190-
191159
## Server-Side Implementation
192160

193161
### Basic Middleware Setup

0 commit comments

Comments
 (0)