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

State type is not being properly propagated to draft object in updater produce function #130

Open
cbdeveloper opened this issue May 27, 2024 · 1 comment

Comments

@cbdeveloper
Copy link

Hey there,

I was trying to use the useImmer and pass the immer producer function, but it seems that the strict type is not being properly propagated to the draft argument object.

As we can see here, draft is being evaluated as Draft<S>, and accepts anything without throwing a type error.

image
image

If I pass the object directly, it works fine:

image

Am I missing something?

Thank you

@mweststrate
Copy link
Collaborator

screenshot are not debuggable. please create a minimal repro in codesandbox.io or something similar.

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

No branches or pull requests

2 participants