Skip to content

Fix incorrect copy-paste usage of isLoading and data.hash in useWriteContractSponsored example#425

Open
autumncrypto wants to merge 1 commit intoAbstract-Foundation:mainfrom
autumncrypto:autumncrypto-patch-1
Open

Fix incorrect copy-paste usage of isLoading and data.hash in useWriteContractSponsored example#425
autumncrypto wants to merge 1 commit intoAbstract-Foundation:mainfrom
autumncrypto:autumncrypto-patch-1

Conversation

@autumncrypto
Copy link
Copy Markdown

@autumncrypto autumncrypto commented Mar 28, 2026

Fixed inconsistencies in the useWriteContractSponsored example in the README.

Replaced isLoading with isPending to match the behavior of mutations in TanStack Query v5. Updated transaction hash display from data?.hash to data, since the hook returns the transaction hash directly (not an object).

These changes align the documentation with the actual hook implementation and prevent confusion when integrating the example.


PR-Codex overview

This PR focuses on updating the state management in the SponsoredContractWrite component, changing the loading state variable and adjusting the display of the transaction hash.

Detailed summary

  • Replaced isLoading with isPending for button disabling and loading indication.
  • Updated button text to reflect the new isPending state.
  • Changed the transaction hash display from data?.hash to data.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

…ContractSponsored example

Fixed inconsistencies in the `useWriteContractSponsored` example in the README.

Replaced `isLoading` with `isPending` to match the behavior of mutations in TanStack Query v5.
Updated transaction hash display from `data?.hash` to `data`, since the hook returns the transaction hash directly (not an object).

These changes align the documentation with the actual hook implementation and prevent confusion when integrating the example.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

⚠️ No Changeset found

Latest commit: 149558a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 28, 2026

PR Summary

Low Risk
Low risk documentation-only change; updates the README example to match the hook’s actual mutation state (isPending) and return value (data as tx hash).

Overview
Fixes the useWriteContractSponsored README example to use isPending (instead of isLoading) for button disabling/loading copy, and to display the returned transaction hash directly from data (instead of data?.hash).

Written by Cursor Bugbot for commit 149558a. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant