Skip to content

Commit

Permalink
fix: add initialState to deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush987goyal committed Feb 15, 2020
1 parent 0770d04 commit b394f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const useMethods = <M, T>(createMethods: CreateMethods<M, T>, initialState: T):
acc[type] = (...payload) => dispatch({ type, payload });
return acc;
}, {} as WrappedMethods<M>);
}, [createMethods]);
}, [createMethods, initialState]);

return [state, wrappedMethods];
};
Expand Down

0 comments on commit b394f3d

Please sign in to comment.