Closed aeons closed 3 years ago
Per https://immerjs.github.io/immer/docs/return#producing-undefined-using-nothing, you can return the constant nothing to set a draft to undefined.
nothing
undefined
This fails when using useImmer, with Type 'Nothing' is not assignable to type 'void | T | undefined'.
useImmer
Type 'Nothing' is not assignable to type 'void | T | undefined'.
I suspect the machinery for nothing is just missing from the types in this repo.
Fixed in 0.5.1
Per https://immerjs.github.io/immer/docs/return#producing-undefined-using-nothing, you can return the constant
nothing
to set a draft toundefined
.This fails when using
useImmer
, withType 'Nothing' is not assignable to type 'void | T | undefined'.
I suspect the machinery for
nothing
is just missing from the types in this repo.