Closed dancheskus closed 4 years ago
Yes, it's just a merge issue (between two PRs) on develop
, i'll fix it. Or you can make a PR to fix it if you want ;-) Just need to add the second parameter.
I'll make it
should I fork your project? I cannot push to your repo.
Yes, but too late, i'm going to fix it now 😜
It's fixed.
https://github.com/thibaultboursier/use-timer/blob/250d8c91fdc843fa6e5e276f0c726ba803a37a34/src/useTimer.ts#L41
dispatch requires payload here
Argument of type '{ type: "start"; }' is not assignable to parameter of type '{ type: "advanceTime"; payload: { timeToAdd: number; }; } | { type: "pause"; } | { type: "reset"; payload: { initialTime: number; }; } | { type: "set"; payload: { newTime: number; }; } | { type: "start"; payload: { ...; }; } | { ...; }'. Property 'payload' is missing in type '{ type: "start"; }' but required in type '{ type: "start"; payload: { initialTime: number; }; }'.