Skip to content

Conversation

thegoobs
Copy link

@thegoobs thegoobs commented Oct 4, 2024

useFetch experimental support for React Suspense works great when the call made is only used once. In the event of an application successfully suspending after a service call, and then triggering that same call again, the suspense mechanism does not suspend as expected. This is because the suspenseStatus ref used to keep track of the suspense status is never reset! This change makes it so that when the suspense promise is created, the suspenseStatus ref is reset so that the promise can be successfully thrown for React to catch.

useFetch experimental support for React Suspense works great when the call made is only used once. In the event of an application successfully suspending after a service call, and then triggering that same call again, the suspense mechanism does not suspend as expected. This is because the suspenseStatus ref used to keep track of the suspense status is never reset! This change makes it so that when the suspense promise is created, the suspenseStatus ref is reset so that the promise can be successfully thrown for React to catch.
@thegoobs
Copy link
Author

thegoobs commented Oct 4, 2024

Not sure how to assign anyone to this PR to get the ball rolling, but I do fear that this might not be maintained as closely as it has been in the past. @alex-cory hoping that you can get some eyes on this soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant