You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to pass generic parameter type to my produce function in order to propagate that generic to type of draft itself like so:
SearchContextProvider:
Reducer:
State for the draft to be applied:
Error:
This only occures with generic, if I use concrete type I won't get such error (namely If I replace generic with ResultDummy - error vanishes.
How do I go about it since this Provider supposed to be used in different part of the code and should receive different type depends on part of the code where it is used. Thank you!
🙋♂ Question
I am unable to pass generic parameter type to my produce function in order to propagate that generic to type of draft itself like so:
SearchContextProvider:
Reducer:
State for the draft to be applied:
Error:
This only occures with generic, if I use concrete type I won't get such error (namely If I replace generic with
ResultDummy
- error vanishes.How do I go about it since this Provider supposed to be used in different part of the code and should receive different type depends on part of the code where it is used. Thank you!
Here is playground where I reproduced the issue:
https://codesandbox.io/s/produce-with-generic-vchkj4
Environment
We only accept questions against the latest Immer version.
The text was updated successfully, but these errors were encountered: