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.
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 asDraft<S>
, and accepts anything without throwing a type error.If I pass the object directly, it works fine:
Am I missing something?
Thank you