'How to fix rendering error in Redux-React?

I have a question about React-Redux and how exactly does it work. In the code below I have 2 dispatch in a function. The first one overwrites some data in the reducer , and the second one already makes an action using the data that was written above. but it doesn't work as I expect. It works only from 2 times and so constantly. But at the same time, if I put a dependency in the useEffect on changing the data that I change in 1 dispatch, then everything works correctly and from 1 time. I'm just really curious what the problem is here. Why are my components not responding to reducer changes as they are to useState changes

  const changeAmount = (top) => {
    dispatch({ type: DATA_FOR_REPOSTS_CHANGE_TOP, data: top });
    dispatch(getListReportsApiAction(isDataForReports));
  };


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source