Sas-Areku / app-page

https://app-page-nine.vercel.app
0 stars 0 forks source link

delayedDelete() is using an older state of apps #13

Closed Sas-Areku closed 1 year ago

Sas-Areku commented 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?