Closed Sas-Areku closed 1 year ago
When delayedDelete() runs after being triggered by setTimeout(), it's using an old version of apps state.
The version of apps state it uses is the state that 'apps' was when setTimeout() began its timer.
Somehow, 'apps' state needs to be updated within the context of setTimeout().
Perhaps utilizing useEffect when state updates?
When delayedDelete() runs after being triggered by setTimeout(), it's using an old version of apps state.
The version of apps state it uses is the state that 'apps' was when setTimeout() began its timer.
Somehow, 'apps' state needs to be updated within the context of setTimeout().
Perhaps utilizing useEffect when state updates?