Currently, due to the logic built in, the storeWillMount cleanup is called once between calls (as per React strict mode) and a second time before the actual unmount. But the actual unmount was executed during the useEffect cleanup and was also executed twice in React strict mode, so the second [storeWillMount cleanup] call occurred between useEffect calls, breaking the logic.