Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ad hoc data fetching with Suspense #24504

Closed
OliverJAsh opened this issue May 5, 2022 · 5 comments
Closed

Ad hoc data fetching with Suspense #24504

OliverJAsh opened this issue May 5, 2022 · 5 comments
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@OliverJAsh
Copy link

OliverJAsh commented May 5, 2022

.@aaronabramov suggested that I file an issue for this: https://twitter.com/dan_abramov/status/1522207779984793601


👋 I have a question about React 18 + Suspense. From the docs:

Ad hoc data fetching with Suspense is technically possible, but still not recommended as a general strategy.

When can I find more information about how to do this?

The reason I ask is because at Unsplash we have basically created our own routing / data fetching framework after running into too many limitations with existing solutions—so we'll need to figure out how to incorporate Suspense into our data fetching framework.

The best example I've found so far is this talk by Jared Palmer but I suspect it's outdated now?

@OliverJAsh OliverJAsh added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label May 5, 2022
@gaearon
Copy link
Collaborator

gaearon commented May 5, 2022

Does your framework allow refetching or cache invalidation?

@OliverJAsh
Copy link
Author

OliverJAsh commented May 5, 2022

No, once the data has been fetched, we never attempt to fetch it again—we re-use the cached result from the previous request (which we currently store in Redux).

@rajington
Copy link

rajington commented May 7, 2022

Maybe there are open source frameworks that are on the right path? Or is data fetching in v18 itself still not ready for primetime? (also get if it's a tough question to answer and still early).

I could do a codesandbox with all the different suspense implementations in v18, but I'm not sure if I'm familiar enough to test other than a single data fetch.

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants