Skip to content

docs(tutorial): read isPending at top level from useLogin/useLogout - #7641

Open
coach-K wants to merge 1 commit into
refinedev:mainfrom
coach-K:docs/7640-uselogin-ispending
Open

coach-K wants to merge 1 commit into
refinedev:mainfrom
coach-K:docs/7640-uselogin-ispending

Conversation

@coach-K

@coach-K coach-K commented Oct 25, 2026

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

  • Related issue(s) linked
  • Tests for the changes have been added (docs-only change)
  • Docs have been added / updated
  • Changesets have been added (not needed: only the private documentation package is changed)

What is the current behavior?

The "Logging In & Out" tutorial (and the React Router navigation tutorial) destructure isPending from a nested mutation object:

const {
  mutate,
  mutation: { isPending },
} = useLogin();

In current @refinedev/core, useLogin and useLogout return { ...mutation }, so there is no mutation property and the snippet fails.

What is the new behavior?

The snippets read isPending at the top level, which matches the hook source and the tutorial's own sandpack files:

const { mutate, isPending } = useLogin();

Files updated:

  • documentation/tutorial/authentication/logging-in-out/index.md (useLogin and useLogout)
  • documentation/tutorial/routing/navigation/react-router/index.md (useLogout)
  • documentation/tutorial/routing/navigation/react-router/sandpack.tsx (useLogout)

Closes #7640

Notes for reviewers

useUpdate examples that use mutation: { isPending } were left as they are. That hook does return a nested mutation object (see packages/core/src/hooks/data/useUpdate.ts, which returns { mutation: mutationResult, mutate, mutateAsync, overtime }).

@changeset-bot

changeset-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: afb2437

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

@coach-K

coach-K commented Oct 26, 2026

Copy link
Copy Markdown
Author

Hi @DoguhanOzgurAkca @BatuhanW, could one of you take a look when you have a moment? This fixes #7640. It's a docs-only change, so I haven't added a changeset. Happy to adjust anything. Thanks!

This branch has not been deployed

No deployments
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.

[DOC] Outdated useLogin and useLogout destructuring in "Logging In & Out" tutorial

1 participant