Closed DanDroryAu closed 12 months ago
Hey @chrisvander, I've also noticed my types were wrong. This morning typescript casted them correctly. I've got to update the set
functions arguments to accept an unknown[]
rest type.
@chrisvander, You just pushed your fix before I amended my commit.
Different workflow, my apologies.
I've simplified it by making the rest params of type []
, which is the same type that the offical middleware uses. Check immer.ts
middleware. It's rest type gets cast to []
.
Let me know if you want me to revert to your fix instead.
Oh, interesting! I would prefer reverting to my fix because I don't think that the set()
call passes the linter check without the adjusted type I put in. Is []
the same as using unknown[]
?
Oh, interesting! I would prefer reverting to my fix because I don't think that the
set()
call passes the linter check without the adjusted type I put in. Is[]
the same as usingunknown[]
?
TBH I've never seen that type before. I just pulled the zustand
repo and checked why the immer.ts
file doesn't throw a type error on the ...a
rest prop. The props type was []
when I inspected it. (And it did pass the linter after that)
I was tinkering with setting the type of it myself but wasn't well versed enough in the typescript setup from Zustand.
Issue: In order to use the redux devtools propperly you have to set the third optional
action
parameter. This allows you to track the action inside of the redux dev tools.This is currently not passed through and in turn makes the dev tools register the action as 'anonymous'
Please look at this comment by a zustand contributor as to why I've added this field.
https://github.com/pmndrs/zustand/issues/705#issuecomment-992976936