Skip to content

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

@cbdeveloper

Description

@cbdeveloper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions