Open morditore opened 3 months ago
Can confirm. We do have tests covering those scenarios which pass oddly enough. I wasn't able to repro with real timers either in Jest.
@morditore and @eps1lon here is a demo of bugfix: https://codesandbox.io/p/sandbox/use-action-state-stuck-forked-2y355f?workspaceId=cb6f0dff-d403-475d-ab82-61ee18a4ad69
it required an edit of ReactHooks.js #31001 The demo is used a simplified standalone version of ReactHooks.js that you can work in CodeSandbox without relying on internal React modules :D
Summary
When multiple client side actions are scheduled via
useActionState
, the "Action queue" promises are processed sequentially as expected. However after the last action promise resolves, the component is not re-rendered. This means, the component is stuck in "loading" without access to "data".Steps to reproduce
Notes
REQUEST_DELAY
is set lower i.e. 1000ms, this "issue" is not present.Is this behavior intentional?