Skip to content

docs: fix isJsonContentType example to type-check#5333

Open
dfedoryshchev wants to merge 1 commit into
reduxjs:masterfrom
dfedoryshchev:docs/isjsoncontenttype-example-typecheck
Open

docs: fix isJsonContentType example to type-check#5333
dfedoryshchev wants to merge 1 commit into
reduxjs:masterfrom
dfedoryshchev:docs/isjsoncontenttype-example-typecheck

Conversation

@dfedoryshchev

Copy link
Copy Markdown
Contributor

The isJsonContentType @example passes headers.get("content-type")?.trim() (type string | undefined) to Array.prototype.includes, which expects a string, so the snippet does not type-check under strict. Guarding the null with (headers.get("content-type") ?? "").trim() makes the example compile.

@codesandbox

codesandbox Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit b41de11
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6a50cbc18eb43700081e1c3d
😎 Deploy Preview https://deploy-preview-5333--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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@reduxjs/rtk-codemods

npm i https://pkg.pr.new/@reduxjs/rtk-codemods@b41de11 -D
yarn add https://pkg.pr.new/@reduxjs/rtk-codemods@b41de11.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/rtk-codemods@b41de11.tgz -D
bun add https://pkg.pr.new/@reduxjs/rtk-codemods@b41de11.tgz -D

@rtk-query/codegen-openapi

npm i https://pkg.pr.new/@rtk-query/codegen-openapi@b41de11 -D
yarn add https://pkg.pr.new/@rtk-query/codegen-openapi@b41de11.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/codegen-openapi@b41de11.tgz -D
bun add https://pkg.pr.new/@rtk-query/codegen-openapi@b41de11.tgz -D

@rtk-query/graphql-request-base-query

npm i https://pkg.pr.new/@rtk-query/graphql-request-base-query@b41de11 -D
yarn add https://pkg.pr.new/@rtk-query/graphql-request-base-query@b41de11.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/graphql-request-base-query@b41de11.tgz -D
bun add https://pkg.pr.new/@rtk-query/graphql-request-base-query@b41de11.tgz -D

@reduxjs/toolkit

npm i https://pkg.pr.new/@reduxjs/toolkit@b41de11 -D
yarn add https://pkg.pr.new/@reduxjs/toolkit@b41de11.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/toolkit@b41de11.tgz -D
bun add https://pkg.pr.new/@reduxjs/toolkit@b41de11.tgz -D

commit: b41de11

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