-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Async render function? #10867
Comments
Looks like a big footgun 🤔 Your component would re-download user data on every single reconciliation, and the component tree would be stuck waiting on your component to finish downloading every time. |
I think if provide |
Please see #6481. |
@Kovensky not necessarily, this is an development choice. I could for instance cache the request if i didn't need to redownload it |
This is exactly what we’re doing with Suspense. Please see second part of my talk: https://reactjs.org/blog/2018/03/01/sneak-peek-beyond-react-16.html. |
Suspense does handle this use case, but I'm looking for a value for fallback (in <Suspense) that will keep the "previous" DOM visible until all the promises have been resolve and the new tree can be rendered? |
Since Fiber is here - did you, as React team, even consider having render functions like:
Obviously, it's changing some core ways about how react is working.
There are few consequences about such approach:
I imagine whole new way you could write apps that rely on async api's:
What do you think about it?
The text was updated successfully, but these errors were encountered: