Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Immer current usage when calling addManyMutably more than once #4420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JacobShafer
Copy link

@JacobShafer JacobShafer commented May 21, 2024

A getCurrent() util was created that checks if the value is draftable before calling current(value). Asequence of addOne() + addOne() hits the case where now state.ids is a plain array, and thus current(state.ids) will throw because it's a plain value and not a draft.

Resolves: #4411

Copy link

codesandbox bot commented May 21, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

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 106de54:

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

Copy link

netlify bot commented May 21, 2024

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

Name Link
🔨 Latest commit 106de54
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/664ce5e6b35ad300083b84d2
😎 Deploy Preview https://deploy-preview-4420--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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.

listenerMiddleware/error Error: [Immer] 'current' expects a draft, got:
1 participant