Skip to content

Commit

Permalink
Fix useEffect usage
Browse files Browse the repository at this point in the history
  • Loading branch information
TimboKZ committed Jan 8, 2022
1 parent 6f68809 commit f6246d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/chonky/src/redux/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ export const useDTE = <Args extends Array<any>>(actionCreator: (...args: Args) =

export const usePropReduxUpdate = <Payload extends any>(actionCreator: (payload: Payload) => any, payload: Payload) => {
const dispatch = useDispatch();
useEffect(() => dispatch(actionCreator(payload)), [dispatch, actionCreator, payload]);
useEffect(() => {
dispatch(actionCreator(payload));
}, [dispatch, actionCreator, payload]);
};

0 comments on commit f6246d1

Please sign in to comment.