fix: add initialState to deps

This commit is contained in:
Ayush Goyal 2020-02-15 19:27:26 +05:30
parent 0770d04c68
commit b394f3d723

View File

@ -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];
};