Skip to content

docs: fix rawErrorResponseSchema description and React 19 StoreProvider pattern#5307

Open
vishalranaut wants to merge 1 commit into
reduxjs:masterfrom
vishalranaut:docs/fix-rawErrorResponseSchema-description
Open

docs: fix rawErrorResponseSchema description and React 19 StoreProvider pattern#5307
vishalranaut wants to merge 1 commit into
reduxjs:masterfrom
vishalranaut:docs/fix-rawErrorResponseSchema-description

Conversation

@vishalranaut

@vishalranaut vishalranaut commented May 30, 2026

Copy link
Copy Markdown

docs: fix rawErrorResponseSchema description and React 19 StoreProvider pattern

Closes #5257
Closes #5291


What this PR does

Fixes two missing/outdated documentation issues in the RTK Query and Next.js guides.


Change 1 — rawErrorResponseSchema missing description (createApi docs)

File: docs/rtk-query/api/createApi.mdx

The rawErrorResponseSchema property section existed as an anchor but had no body text, causing user confusion (see #4989).

Added a description that explains:

  • It validates the error response before transformErrorResponse runs (against the raw server response)
  • How it differs from errorResponseSchema, which validates after transformation
  • When to use one vs. the other
  • A short usage example

Change 2 — Broken useRef store pattern in Next.js guide

File: docs/usage/nextjs.mdx

The existing StoreProvider example using useRef throws this error in React 19:

Error: Cannot access refs during render

Replaced it with the useState lazy initializer pattern:

const [store] = useState(() => makeStore())
return <Provider store={store}>{children}</Provider>

Also added a callout explaining why useRef breaks in React 19 concurrent/Strict Mode.

Verified against:

next: 15+
react: 19.x
@reduxjs/toolkit: ^2.x
react-redux: ^9.x

Checklist

  • I have read the CONTRIBUTING.md
  • Docs only changes — no source code modified
  • Tested locally with yarn docs to confirm both pages render correctly
  • New StoreProvider example verified in a fresh Next.js 15 + React 19 project

@codesandbox

codesandbox Bot commented May 30, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit c6d05b5
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6a1b03a25882dc0008a2f169
😎 Deploy Preview https://deploy-preview-5307--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c6d05b5:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@aryaemami59 aryaemami59 added Documentation Improvements or additions to documentation RTK-Query Issues related to Redux-Toolkit-Query labels May 30, 2026
@aryaemami59 aryaemami59 changed the title docs: fix rawErrorResponseSchema description and React 19 StoreProvider pattern docs: fix rawErrorResponseSchema description and React 19 StoreProvider pattern May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation RTK-Query Issues related to Redux-Toolkit-Query

Projects

None yet

2 participants